CVE-2026-100689: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in gitpython-developers GitPython
GitPython before 3.1.62 does not validate the `path` field read from an untrusted .gitmodules file when updating submodules. While a prior fix (GHSA-hmq2-w58f-27jc) added Submodule._validated_name() to constrain the `name` field, and GitPython's own containment guard Submodule._to_relative_path() is applied in add() and move(), Submodule.update() derives the absolute checkout location from the raw `path` value without that guard. A .gitmodules entry containing directory traversal components (e.g., path = ../../../tmp/escaped) can therefore cause directories to be created via os.makedirs() outside the repository working tree, populated from the submodule URL on the clone path, and removed via shutil.rmtree() when force_remove is used. Exploitation requires an application flow that updates submodules at a non-HEAD commit (such as a historical-commit API); the common clone-then-update flow re-derives the path from a canonical tree lookup and is not affected. The issue is fixed in GitPython 3.1.62.
AI Analysis
Technical Summary
GitPython prior to version 3.1.62 does not properly validate the `path` field read from untrusted .gitmodules files when updating submodules. While earlier fixes constrained the `name` field and applied containment guards in some operations, the Submodule.update() method derives the absolute checkout location directly from the raw `path` value without validation. This allows directory traversal components in the `path` (e.g., ../../../tmp/escaped) to cause directories to be created outside the repository working tree, populated from the submodule URL, and removed when force_remove is used. Exploitation requires an application flow that updates submodules at a non-HEAD commit, such as a historical-commit API. The common clone-then-update flow is not affected. The issue is resolved in GitPython 3.1.62.
Potential Impact
An attacker supplying a crafted .gitmodules file with directory traversal in the `path` field can cause GitPython to create and remove directories outside the intended repository directory during submodule update operations at non-HEAD commits. This can lead to unauthorized filesystem modifications, potentially impacting system integrity. The vulnerability has a high severity CVSS score of 8.7.
Mitigation Recommendations
Upgrade GitPython to version 3.1.62 or later, where this path traversal vulnerability is fixed. No other mitigations are indicated. Users relying on submodule updates at non-HEAD commits should prioritize applying this update.
CVE-2026-100689: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in gitpython-developers GitPython
Description
GitPython before 3.1.62 does not validate the `path` field read from an untrusted .gitmodules file when updating submodules. While a prior fix (GHSA-hmq2-w58f-27jc) added Submodule._validated_name() to constrain the `name` field, and GitPython's own containment guard Submodule._to_relative_path() is applied in add() and move(), Submodule.update() derives the absolute checkout location from the raw `path` value without that guard. A .gitmodules entry containing directory traversal components (e.g., path = ../../../tmp/escaped) can therefore cause directories to be created via os.makedirs() outside the repository working tree, populated from the submodule URL on the clone path, and removed via shutil.rmtree() when force_remove is used. Exploitation requires an application flow that updates submodules at a non-HEAD commit (such as a historical-commit API); the common clone-then-update flow re-derives the path from a canonical tree lookup and is not affected. The issue is fixed in GitPython 3.1.62.
CVSS v4.0
Score 8.7high
Affected software
gitpython-developers
GitPython
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
GitPython prior to version 3.1.62 does not properly validate the `path` field read from untrusted .gitmodules files when updating submodules. While earlier fixes constrained the `name` field and applied containment guards in some operations, the Submodule.update() method derives the absolute checkout location directly from the raw `path` value without validation. This allows directory traversal components in the `path` (e.g., ../../../tmp/escaped) to cause directories to be created outside the repository working tree, populated from the submodule URL, and removed when force_remove is used. Exploitation requires an application flow that updates submodules at a non-HEAD commit, such as a historical-commit API. The common clone-then-update flow is not affected. The issue is resolved in GitPython 3.1.62.
Potential Impact
An attacker supplying a crafted .gitmodules file with directory traversal in the `path` field can cause GitPython to create and remove directories outside the intended repository directory during submodule update operations at non-HEAD commits. This can lead to unauthorized filesystem modifications, potentially impacting system integrity. The vulnerability has a high severity CVSS score of 8.7.
Mitigation Recommendations
Upgrade GitPython to version 3.1.62 or later, where this path traversal vulnerability is fixed. No other mitigations are indicated. Users relying on submodule updates at non-HEAD commits should prioritize applying this update.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-09-26T02:37:41.037Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6ab7c9adf7a7c5410652fd58
Added to database: 09/26/2026, 13:33:33 UTC
Last enriched: 09/26/2026, 13:47:50 UTC
Last updated: 09/27/2026, 04:31:24 UTC
Views: 15
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.