CVE-2026-76219
PoC largeArgument Injection Arbitrary File Overwrite in GitPython
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.
| gitpython project GitPython | All versions before 3.1.58 (fixed in 3.1.58) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
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 news0 stories
No ingested article mentions this CVE yet.