Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker crafts .gitmodules with ../ traversal path
-
DeliveryVictim app updates submodules at non-HEAD commit
-
ExploitSubmodule.update() uses raw path unvalidated
-
Executionos.makedirs()/populate/rmtree outside working tree
-
ImpactArbitrary file/dir write or deletion on host
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the affected application to invoke Submodule.update() while checking out submodules at a NON-HEAD (historical) commit - for example a historical-commit browsing/API feature - because only that flow derives the checkout location from the raw untrusted |
| Impact | This is a genuine but conditionally-exploitable path traversal (CWE-22) that in practice sits at LOW-MEDIUM real-world priority despite the vendor's 8.7 CVSS 4.0 score. Positive signals: the vendor vector is AV:N/AC:L/PR:N/UI:N (network, no auth, no interaction) and a patch is confirmed available in 3.1.62. Countervailing signals: there is no EPSS score, no CISA KEV listing, and no public exploit code in the provided data, so exploitation is theoretical at this time. The vendor's VC:H (confidentiality) rating conflicts with the description, which describes only directory creation via os.makedirs(), population from the submodule URL, and deletion via shutil.rmtree() - these are integrity/availability write-and-delete primitives OUTSIDE the working tree, not information disclosure; VC:H therefore appears misassigned and I/A impact is understated. The AC:L rating also under-weights the real precondition: exploitation is explicitly gated on an application flow that updates submodules at a non-HEAD commit (e.g. a historical-commit API), while the common clone-then-update path re-derives the path from a canonical tree lookup and is NOT affected - this warrants AC:H. Net: a real, patchable bug in a ubiquitous library, but the non-default trigger flow and absence of EPSS/KEV/POC place it below actively-exploited criticals. |
| Exploit ScenarioDerived | An attacker publishes a repository whose .gitmodules contains a traversal path such as |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 26, 2026
GitPython before 3.1.62 is vulnerable to a path traversal (CWE-22) in Submodule.update() that allows unauthenticated remote attackers to create, populate from a submodule URL, and potentially delete directories outside the repository working tree when an application updates submodules at a non-HEAD (historical) commit. The flaw stems from the path field in an untrusted .gitmodules file being used without the _to_relative_path() containment guard that is applied in add() and move(). Exploitation requires an application flow that checks out submodules at a historical commit and an attacker-controlled repository; the standard clone-then-update flow re-derives the path from a canonical tree lookup and is not affected. No public exploit code or confirmed active exploitation (CISA KEV) exists at time of analysis, and the independent assessment rates real-world priority as low-to-medium despite the vendor's CVSS 4.0 score of 8.7.
RemediationAI
Upgrade to GitPython 3.1.62 or later (vendor-released patch). This version applies the Submodule._to_relative_path() containment guard within Submodule.update(), preventing path traversal. Consult the vendor advisory at https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-59cr-6r3x-644w for patch details. If immediate upgrade is not possible, avoid using application flows that call Submodule.update() at non-HEAD (historical) commits; disabling historical-commit submodule checkout features removes the vulnerable code path but reduces functionality for legitimate historical browsing. Additionally, ensure that force_remove is not used when processing submodules from untrusted repositories, as that parameter enables the shutil.rmtree() deletion vector. Applications can also pre-validate .gitmodules path values to reject absolute paths or directory traversal sequences before passing repositories to GitPython, though this is a compensating control that must be applied consistently and does not fix the underlying library flaw.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
GitPython is a Python library for programmatic interaction with Git repositories. The vulnerability resides in the submodule handling logic: when Submodule.update() is invoked, it reads the path field from .gitmodules and uses that raw value to derive the absolute checkout location without applying Submodule._to_relative_path(), which enforces containment within the working tree. While an earlier fix (GHSA-hmq2-w58f-27jc) added Submodule._validated_name() to validate the name field, and the containment guard is used in Submodule.add() and Submodule.move(), update() was missed. A .gitmodules entry such as path = ../../../tmp/escaped therefore causes os.makedirs() to create directories outside the repository, which may then be populated with content cloned from the submodule URL, and can be removed via shutil.rmtree() if force_remove is used. The vulnerable flow is specifically triggered when updating submodules at a non-HEAD commit (e.g., a historical-commit API), because only then does the code derive the checkout path from the raw .gitmodules value rather than from a canonical tree lookup. The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), and affected products correspond to CPE cpe:2.3:a:gitpython-developers:gitpython:*:*:*:*:*:*:*:* (all versions before 3.1.62).
Know when Gitpython gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Untrusted .gitmodules needs no auth (PR:N) but only the non-default non-HEAD update flow triggers it (AC:H); writes/deletes escape the working tree (S:C) giving I:H/A:H, no read so C:N.
AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
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.
Blast Radius
ecosystem impact- 271 pypi packages depend on gitpython (164 direct, 109 indirect)
Ecosystem-wide dependent count for version 3.1.62.
Articles & Coverage 1
Technical POC Analysis
CWE-22 (the advisory also tags CWE-73): external control of a path that is meant to be confined to the repository working tree.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
GitPython, a widely used Python library embedded in CI/CD pipelines, release automation, and internal developer tooling, contains a path traversal flaw in its submodule update logic that allows an attacker-controlled repository to create, populate, or delete directories outside the intended project working tree. Exposure is limited to applications that check out submodules at historical (non-HEAD) commits, but those are precisely the build and deployment environments that typically hold elevated credentials and shared file-system access. Leadership should treat this as a supply-chain integrity issue affecting build hosts rather than a routine dependency bump, since the consequence is corruption or deletion of files outside the repository boundary.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
All versions of package gitpython are vulnerable to Remote Code Execution (RCE) due to improper user input validation, w
Arbitrary code execution in GitPython before 3.1.59 arises from unsafe re-serialization of multi-line, quoted git-config
Command injection in GitPython before 3.1.51 allows low-privileged attackers to bypass the `check_unsafe_options` blockl
Command injection in GitPython 3.1.30-3.1.46 allows remote authenticated attackers to execute arbitrary commands via und
Command injection and arbitrary file overwrite in GitPython before 3.1.51 expose applications that pass attacker-control
Arbitrary directory creation and potential hook-based code execution in GitPython affects all releases before 3.1.59. Th
Environment variable exfiltration in GitPython before 3.1.52 allows any attacker who controls a URL passed to `Repo.clon
GitPython before 3.1.59 discloses local file content through exception messages when parsing .gitmodules files that cont
GitPython is a python library used to interact with Git repositories. Rated high severity (CVSS 7.8), this vulnerability
Arbitrary file read in GitPython before 3.1.59 allows low-privileged remote attackers to exfiltrate sensitive files by s
Arbitrary file read in GitPython versions before 3.1.59 exposes sensitive filesystem content to low-privileged network a
GitPython is a python library used to interact with Git repositories. Rated medium severity (CVSS 6.5), this vulnerabili
Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| SUSE Linux Enterprise Desktop 15 SP7 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP7 | Affected |
| SUSE Linux Enterprise Server 15 SP7 | Affected |
| SUSE Linux Enterprise Server 16.0 | Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP4 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Python 3 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP4 | Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP5 | Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Affected |
| SUSE Linux Enterprise Server 15 SP6 | Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Affected |
| SUSE Linux Enterprise Desktop 15 SP4 | Affected |
| SUSE Linux Enterprise Desktop 15 SP5 | Affected |
| SUSE Linux Enterprise Desktop 15 SP6 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Affected |
| SUSE Manager Proxy 4.3 | Affected |
| SUSE Manager Retail Branch Server 4.3 | Affected |
| SUSE Manager Server 4.3 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-87662
GHSA-cw5h-x3x9-4mwp
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB