Skip to main content

GitPython CVE-2026-76217

| EUVDEUVD-2026-62458 HIGH
External Control of File Name or Path (CWE-73)
2026-08-19 VulnCheck GHSA-w672-239g-c3gr
7.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to GitPython-consuming application
  2. Delivery
    Craft request with pathspec_from_file and pathspec_file_nul kwargs
  3. Exploit
    Application forwards kwargs to IndexFile.remove() or Head.checkout()
  4. Execution
    Git executes with --pathspec-from-file and --pathspec-file-nul flags
  5. Persist
    Unmatched pathspec error returns target file contents verbatim
  6. Impact
    Extract 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
1 PoC candidate (unverified) Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

GitPython 0 <3.1.58

Affected Packages

pypi gitpython fix: 3.1.58

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

Vendor (VulnCheck) PRIMARY 7.1 HIGH
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
vuln.today AI 6.5 MEDIUM

Network vector and PR:L reflect attacker-controlled kwargs reaching a web-exposed GitPython API; no integrity or availability impact applies.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
SUSE 6.5 MEDIUM
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Red Hat 6.5 MEDIUM

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 19, 2026 - 15:17 EUVD
CVE Published
Aug 19, 2026 - 14:02 cve.org
HIGH 7.1

DescriptionCVE.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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 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

Why It Matters

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.

Business Impact: High
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

EPSS Score
0.3%
Top 79% exploitable
Prevalence
Medium
popular Python Git library, common in CI/CD and dev tooling
Data Quality
7 sources
Confidence: High

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

56
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2022-24439 CRITICAL POC
9.8 Dec 06

All versions of package gitpython are vulnerable to Remote Code Execution (RCE) due to improper user input validation, w

CVE-2026-78676 CRITICAL POC
9.3 Aug 25

Arbitrary code execution in GitPython before 3.1.59 arises from unsafe re-serialization of multi-line, quoted git-config

CVE-2026-67325 HIGH POC
8.7 Aug 01

Command injection in GitPython before 3.1.51 allows low-privileged attackers to bypass the `check_unsafe_options` blockl

CVE-2026-67323 HIGH POC
8.6 Aug 01

Command injection and arbitrary file overwrite in GitPython before 3.1.51 expose applications that pass attacker-control

CVE-2026-78677 HIGH POC
8.7 Aug 25

Arbitrary directory creation and potential hook-based code execution in GitPython affects all releases before 3.1.59. Th

CVE-2026-67322 HIGH POC
8.7 Aug 01

Environment variable exfiltration in GitPython before 3.1.52 allows any attacker who controls a URL passed to `Repo.clon

CVE-2026-78675 HIGH POC
8.6 Aug 25

GitPython before 3.1.59 discloses local file content through exception messages when parsing .gitmodules files that cont

CVE-2023-40590 HIGH POC
7.8 Aug 28

GitPython is a python library used to interact with Git repositories. Rated high severity (CVSS 7.8), this vulnerability

CVE-2026-78679 HIGH POC
7.1 Aug 25

Arbitrary file read in GitPython before 3.1.59 allows low-privileged remote attackers to exfiltrate sensitive files by s

CVE-2026-78678 HIGH POC
7.1 Aug 25

Arbitrary file read in GitPython versions before 3.1.59 exposes sensitive filesystem content to low-privileged network a

CVE-2023-41040 MEDIUM POC
6.5 Aug 30

GitPython is a python library used to interact with Git repositories. Rated medium severity (CVSS 6.5), this vulnerabili

CVE-2023-40267 CRITICAL
9.8 Aug 11

GitPython before 3.1.32 does not block insecure non-multi options in clone and clone_from. Rated critical severity (CVSS

Vendor 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

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy