GitPython before 3.1.58 Arbitrary File Overwrite via read-tree
gitpython-developers GitPython
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| gitpython PyPI |
|
|
Original 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.
From the CVE record · VulnCheck
References
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-4gmw-gg2m-w46pVendor advisory
- vulncheck.com/advisories/gitpython-before-arbitrary-file-overwrite-via-read-treeAdvisory
- github.com/CVEProject/cvelistV5/tree/main/cves/2026/76xxx/CVE-2026-76219.json
- nvd.nist.gov/vuln/detail/CVE-2026-76219
- github.com/gitpython-developers/GitPython/pull/2204
- github.com/gitpython-developers/GitPython/commit/9b5dcaf85da5946dbf69dcd53f9edba08f760b32
- github.com/gitpython-developers/GitPython
- github.com/gitpython-developers/GitPython/releases/tag/3.1.58
- pypi.org/project/gitpython
- github.com/advisories/GHSA-4gmw-gg2m-w46p