ZeroHour

CVE-2026-76219

PoC large

Argument Injection Arbitrary File Overwrite in GitPython

CVSS 4.0
7.2 high
EPSS
<1%p22
Published
()
Modified
AI analysis

GitPython versions before 3.1.58 contain an argument injection flaw (CWE-88) in the IndexFile.from_tree, IndexFile.reset, and IndexFile.merge_tree methods, which append caller-influenced treeish strings to a git read-tree command without option validation or argument separation. An attacker who can influence those treeish values can inject the --index-output option, causing Git to write a valid git-index blob to an arbitrary path and destroy existing file content at any path writable by the affected process. The impact is file corruption or destruction (high integrity and availability impact in the 7.2 CVSS 4.0 score), with no confidentiality loss, no user interaction required, and only low-privileged access needed to influence the input. Any Python application or tool in the pip ecosystem that calls the affected IndexFile methods with untrusted treeish input is affected, though the vulnerable code paths are relatively narrow so real-world exposure depends on how applications invoke them. Exploitation in the wild is not currently known; one public proof of concept is referenced in the project advisory GHSA-4gmw-gg2m-w46p, and EPSS estimates only a 0.3% probability of exploitation in the next 30 days.

What to do: Upgrade to GitPython 3.1.58 or later. As an interim mitigation, do not pass attacker-controlled treeish strings to IndexFile.from_tree, IndexFile.reset, or IndexFile.merge_tree, or validate inputs to reject option-like tokens such as values beginning with a dash. Run pip audit or inspect dependency trees to locate vulnerable GitPython versions in your environments and check whether attacker-writable file paths could be overwritten via injected --index-output.

Affected
gitpython project GitPythonAll versions before 3.1.58 (fixed in 3.1.58)
Estimated exposure
largetens of thousands to hundreds of thousands of Python environments ship GitPython as a direct or transitive pip dependency, though only those passing untrusted… — GitPython is an extremely widely installed library in the pip ecosystem with very high PyPI download volumes and broad use as a dependency of other tools, but the flaw requires the specific IndexFile.from_tree/reset/merge_tree code paths…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

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.

Vendors
gitpython project
Products
gitpython
Ecosystems
pip
Weakness
CWE-88
Vector
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
GHSA
GHSA-4gmw-gg2m-w46p (high)

In the news

No ingested article mentions this CVE yet.