Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to GitPython-consuming application
-
DeliveryCraft request with pathspec_from_file and pathspec_file_nul kwargs
-
ExploitApplication forwards kwargs to IndexFile.remove() or Head.checkout()
-
ExecutionGit executes with --pathspec-from-file and --pathspec-file-nul flags
-
PersistUnmatched pathspec error returns target file contents verbatim
-
ImpactExtract full file contents from GitCommandError.stderr response
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V5 - File Handling File name/path control
|
| Exploitation Conditions | Exploitation requires that an attacker can influence the **kwargs argument passed to either IndexFile.remove() or Head.checkout() in a GitPython-consuming application - specifically, supplying the pathspec_from_file key (mapping to --pathspec-from-file) pointing to an attacker-chosen file path, combined with pathspec_file_nul=True (mapping to --pathspec-file-nul). The --pathspec-file-nul flag is the critical amplifier: without it, only the first line of the target file is disclosed; with it, the entire file contents are returned. The CVSS 4.0 PR:L indicates low-privilege authenticated access to the application is required. Exploitation is bounded by the OS-level file permissions of the process running GitPython - only files readable by that user account can be exfiltrated. Applications that validate or restrict kwargs before passing them to these methods, or that do not expose these methods to external or user-supplied input, are not exploitable remotely. Non-default configuration is NOT required - the vulnerability exists in default GitPython installations whenever these methods accept unvalidated kwargs. |
| Impact | The CVSS 4.0 score of 7.1 (AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N) reflects a network-reachable, low-complexity flaw with low-privilege prerequisites and high confidentiality impact. Real-world exploitability is strongly gated on whether attacker-controlled data can reach the **kwargs of the two vulnerable methods - a pattern that is common in web-based Git management panels, CI/CD APIs, and code review platforms, but not guaranteed. The public proof of concept in the GHSA advisory significantly lowers exploitation effort for targeted abuse. EPSS data was not provided in this dataset; without it, probabilistic exploitation likelihood cannot be quantified, but the requirement for controlled kwargs input suggests targeted rather than opportunistic mass exploitation. Active exploitation is not confirmed - this CVE is not in CISA KEV. The absence of scope change (SC:N/SI:N/SA:N) limits impact to files readable by the GitPython process, but in server-side contexts this routinely encompasses SSH private keys, application secrets, database credentials, and /etc/passwd. Overall, this is a real priority for any internet-facing application that passes user-supplied parameters into GitPython's remove() or checkout() interfaces; it is lower priority for tightly controlled internal tooling that restricts kwargs. |
| Exploit ScenarioDerived | An attacker with low-privilege access to a web application that offers Git repository management via GitPython submits a crafted API request supplying pathspec_from_file='/etc/passwd' and pathspec_file_nul=True as parameters, which the application forwards without validation to repo.index.remove() or repo.heads[0].checkout(). GitPython passes these as --pathspec-from-file and --pathspec-file-nul to the underlying git subprocess; Git returns the file contents verbatim in an unmatched-pathspec error, which GitPython surfaces via GitCommandError.stderr. A complete proof of concept demonstrating this exact technique - including the Repo(), index.remove(), and stderr extraction pattern - is published in the vendor GHSA advisory GHSA-hh9p-6wh2-4mfc. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 19, 2026
Arbitrary file read in GitPython versions through 3.1.57 allows low-privileged users who can influence kwargs passed to IndexFile.remove() or Head.checkout() to exfiltrate the complete contents of any file readable by the hosting process. The attack chains two unsanitized Git flags - --pathspec-from-file and --pathspec-file-nul - causing Git to return verbatim file contents through a GitCommandError exception that GitPython surfaces in-band. A detailed proof of concept is publicly available in the vendor GHSA advisory; this vulnerability is not currently listed in CISA KEV.
RemediationAI
The primary fix is upgrading GitPython to version 3.1.58 or later, which introduces option sanitization at the affected call sites. The upstream fix is available as commit f2550b65bf60ca087190981e2c7b6865e201f40c and pull request #2204 at https://github.com/gitpython-developers/GitPython/pull/2204; the fix version 3.1.58 is cited by the vendor GHSA advisory and VulnCheck but has not been independently confirmed as a released PyPI package at time of analysis - verify PyPI availability before deploying. If immediate upgrade is not feasible, the most targeted compensating control is to wrap calls to IndexFile.remove() and Head.checkout() with an explicit kwargs allowlist that raises an error on any unrecognized key; this blocks the attack without affecting normal GitPython usage. Applications that do not expose these methods to externally derived input are not remotely exploitable, so auditing code paths that pass user-controlled data into these functions is a practical triage step. Do not rely on catching GitCommandError as a mitigation - the file contents are already returned in the exception.
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 (CPE: cpe:2.3:a:gitpython-developers:gitpython:*:*:*:*:*:*:*:*) is a Python library providing an object-oriented interface to Git repositories, widely used in CI/CD pipelines, web-based Git hosting, and developer tooling. The root cause is CWE-73 (External Control of File Name or Path): both IndexFile.remove() at git/index/base.py:1043 and Head.checkout() at git/refs/head.py:268 forward unbounded **kwargs directly into git rm and git checkout subprocess calls without invoking check_unsafe_options() or an allow_unsafe_options guard. The --pathspec-from-file Git option redirects pathspec input from a file rather than the command line. When paired with its documented companion --pathspec-file-nul - the flag that handles paths containing newlines by treating the whole file as a single NUL-delimited pathspec - Git raises an unmatched-pathspec error that quotes the file contents verbatim. GitPython then surfaces that error through GitCommandError.stderr, returning the full file contents in-band to the caller. This primitive is a variant of GHSA-3f7w-8rr8-f37f (TagReference.create() with -F), which had previously assessed these two call sites as safe, missing the --pathspec-file-nul amplification that makes the entire file readable rather than just its first line.
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:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Network vector and PR:L reflect attacker-controlled kwargs reaching a web-exposed GitPython API; no integrity or availability impact applies.
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
GitPython versions before 3.1.58 fail to validate options passed to git rm and git checkout commands in IndexFile.remove() and Head.checkout(). Attackers can supply --pathspec-from-file and --pathspec-file-nul parameters to read arbitrary files accessible to the process, with full file contents returned in GitCommandError.stderr.
Blast Radius
ecosystem impact- 15 pypi packages depend on gitpython (14 direct, 1 indirect)
Ecosystem-wide dependent count for version 3.1.58.
Latest POC
1 PoC candidate from github (unverified)
Sign in to open the public PoC links collected for this CVE.
Executive ViewAI
GitPython versions 3.1.57 and earlier contain an arbitrary file read vulnerability (CVE-2026-76217) with publicly available exploit code that enables low-privileged users to exfiltrate any files readable by the hosting process. Organizations using vulnerable GitPython versions in environments where users influence Git operation parameters face immediate risk of sensitive data exposure. No vendor-released patch has been identified, requiring urgent compensating controls.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Implement strict input validation on all kwargs passed to IndexFile.remove() and Head.checkout() to prevent injection of malicious Git flags; (2) Restrict these function calls to privileged processes only and remove low-privilege user access to Git operations; (3) Configure process-level file system permissions to limit accessible files to those strictly necessary for application function; (4) Deploy network-based monitoring to detect unexpected file access patterns or data exfiltration attempts from affected systems.
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
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
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 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
GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. Rated critical severity (CVSS
Same weakness CWE-73 – External Control of File Name or Path
View allSame technique Information Disclosure
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
| SUSE Linux Enterprise Desktop 15 SP7 | Affected |
| SUSE Linux Enterprise High Performance Computing 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 Manager Proxy 4.3 | Affected |
| SUSE Manager Retail Branch Server 4.3 | Affected |
| SUSE Manager Server 4.3 | 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 Linux Enterprise High Performance Computing 15 SP6 | Affected |
| openSUSE Leap 15.4 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-62458
GHSA-w672-239g-c3gr
NVD
CVE.org
EPSS
VulDB
Exploit-DB