Skip to main content

GitPython CVE-2026-76219

| EUVDEUVD-2026-62460 HIGH
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') (CWE-88)
7.2
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Supply crafted treeish string with --index-output
  2. Delivery
    Pass to IndexFile.from_tree / reset / merge_tree
  3. Exploit
    GitPython invokes git read-tree without -- separator
  4. Execution
    git last-occurrence-wins overrides library temp path
  5. Impact
    Target file overwritten with git-index blob

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Argument sanitization
Exploitation Conditions

The vulnerable application must invoke at least one of three specific GitPython methods - IndexFile.from_tree, IndexFile.reset, or IndexFile.merge_tree - and must forward attacker-controlled input as the treeish positional argument (first argument to from_tree or merge_tree, or the commit keyword argument to reset). The CVSS 4.0 PR:L metric confirms that some form of low-privilege access or authentication to the application is required to supply that input; unauthenticated exploitation (PR:N) is not reflected in the provided vector. The target file path must be writable by the OS user account running the host process - files owned by root or other users are not reachable unless the process runs with elevated privileges. No special git configuration, repository state, or non-default GitPython settings are required; the vulnerability is present in default usage of the three methods. The impact is bounded to overwriting file content with DIRC-format git-index data; arbitrary byte injection into the written file is not possible, ruling out direct code execution via file content manipulation. Applications that never pass user-controlled strings to these three methods are not exploitable regardless of GitPython version.

Impact

The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H) scores 7.2 and indicates network-reachable exploitation requiring only low privileges with no attack complexity or additional preconditions. Real-world exploitability is conditional on an application-layer requirement: the vulnerable code path is only reachable when an application passes attacker-influenced data as the treeish argument to one of the three named methods - a non-trivial precondition that limits exposure to code hosting platforms, CI/CD pipelines, or web tools that accept user-supplied git references and route them through these index operations. The integrity ceiling is bounded: written content is constrained to a valid git-index blob (DIRC magic bytes), not arbitrary attacker-chosen bytes, which rules out direct RCE via content injection; however, destroying or corrupting files such as SSH authorized_keys, cron jobs, application configs, or pip constraints files remains a high-impact outcome. The publicly available proof-of-concept (independently reproduced per the advisory) substantially lowers the exploitation bar. EPSS data was not provided in the available intelligence feed. The combination of a public POC, a simple one-argument injection, and high-value writable-file targets makes this a genuine priority for any Python application that exposes GitPython index operations to external input - but deployments where treeish arguments are always internally generated carry minimal incremental risk.

Exploit ScenarioDerived

An attacker authenticated to a code-review or CI web application that accepts a user-supplied branch or commit reference submits the string --index-output=/home/app/.ssh/authorized_keys as the treeish parameter. The application passes this directly to IndexFile.from_tree(repo, user_input); GitPython appends it to the git read-tree argument list without sanitization, and git's last-occurrence-wins behavior causes the injected --index-output to override the library's internal temp path, overwriting authorized_keys with a git-index blob and locking the process owner out of SSH access. A proof-of-concept confirming this exact behavior - before content reading IMPORTANT ORIGINAL CONTENT, after content starting with DIRC bytes - is documented in GHSA-4gmw-gg2m-w46p.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
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 overwrite in GitPython before 3.1.58 allows attackers who can influence treeish arguments passed to IndexFile.from_tree, IndexFile.reset, or IndexFile.merge_tree to clobber any file writable by the host process with a valid git-index blob. The three affected methods in git/index/base.py forward caller-controlled strings directly to git read-tree with no option sanitization and no -- argument terminator, enabling injection of --index-output=<path>; git's last-occurrence-wins behavior lets the injected flag override the library's internal temp path. A proof-of-concept is publicly documented in GHSA-4gmw-gg2m-w46p; no CISA KEV listing was present at time of analysis.

RemediationAI

Upgrade GitPython to version 3.1.58 or later, which introduces option validation and an argument separator in the affected index methods. The upstream fix is documented in pull request https://github.com/gitpython-developers/GitPython/pull/2204 and patch commit https://github.com/gitpython-developers/GitPython/commit/9b5dcaf85da5946dbf69dcd53f9edba08f760b32. For applications that cannot immediately upgrade, the primary compensating control is to validate all treeish arguments before they reach IndexFile.from_tree, IndexFile.reset, or IndexFile.merge_tree - specifically, enforce an allowlist of acceptable formats (e.g., 40-character hex SHA-1 strings, or known branch/tag names matched against refs), which is more robust than a denylist of option prefixes such as -- that may be bypassed by encoding. A secondary defense is to run the host process under an OS user with minimal filesystem write permissions, restricting the set of writable paths and thereby limiting the blast radius of a successful injection to only those locations. Note that denylist-only validation (rejecting strings containing --index-output) is a weaker control and should not be relied upon as the sole mitigation.

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:2.3:a:gitpython-developers:gitpython:*:*:*:*:*:*:*:*) is a Python library providing an object model for git repositories. The root cause is CWE-88 (Argument Injection or Modification): IndexFile.from_tree (git/index/base.py:388), IndexFile.merge_tree (git/index/base.py:291), and IndexFile.reset (which delegates to from_tree) each construct argument lists for an internal repo.git.read_tree() call by appending caller-supplied treeish strings positionally, with no invocation of check_unsafe_options and no -- separator to terminate git option processing. The git read-tree command natively supports --index-output=<path>, which redirects the serialized index to an arbitrary filesystem path rather than the default location. Because git processes duplicate flags last-occurrence-wins, an injected --index-output embedded in the treeish string overrides the library's own --index-output temp-file argument, writing a valid DIRC-format git-index blob to the attacker-specified path. A prior fix (commit 3af0c251, GHSA-3f7w-8rr8-f37f) hardened only checkout_index and tag; the advisory for that issue acknowledged read_tree as an unguarded call site, but it was never patched until CVE-2026-76219.

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.2 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 8.1 HIGH

PR:L reflects authentication required to supply treeish input; S:U because overwrite is bounded to the host process's own writable filesystem scope; C:N as no data is exfiltrated.

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

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
None
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
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.2

DescriptionCVE.org

GitPython versions before 3.1.58 contain an arbitrary file overwrite vulnerability in IndexFile.from_tree, IndexFile.reset, and IndexFile.merge_tree methods that append caller-influenced treeish strings to git read-tree without option validation or argument separation. Attackers can inject the --index-output option to overwrite arbitrary files with a valid git-index blob, destroying existing file content at attacker-controlled writable paths.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 16 pypi packages depend on gitpython (15 direct, 1 indirect)

Ecosystem-wide dependent count for version 3.1.58.

Executive ViewAI

Why It Matters

GitPython versions before 3.1.58 enable arbitrary file overwrite attacks with publicly available exploit code, affecting any organization deploying this library in production systems. The risk is heightened for CI/CD environments where the library has broad file system access. No vendor patch is currently available, requiring immediate compensating controls.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations include: enforce strict input validation and sanitization on all arguments passed to affected methods (IndexFile.from_tree, IndexFile.reset, IndexFile.merge_tree); operate GitPython-dependent services with minimal file system permissions; restrict which user accounts and processes can invoke these functions; implement real-time file integrity monitoring on sensitive system directories; and segment networks to contain blast radius if a compromised system attempts exploitation.

Threat Intelligence Overview

EPSS Score
0.3%
Top 80% exploitable
Prevalence
High
widely used Python git library in CI/CD and dev tooling
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
8 sources
Confidence: High
EUVD 🇯🇵JVN NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

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

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

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

CVE-2026-67324 CRITICAL
9.3 Aug 01

Command execution in GitPython 3.1.50 arises because its default unsafe-option gate fails to recognize joined short-opti

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-42215 HIGH POC
8.8 May 07

Command injection in GitPython 3.1.30-3.1.46 allows remote authenticated attackers to execute arbitrary commands via und

Vendor StatusVendor

SUSE

Severity: Important
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