ZeroHour

CVE-2026-76217

PoC mass

Arbitrary File Read in GitPython via Unvalidated Options in remove() and checkout()

CVSS 4.0
7.1 high
EPSS
<1%p30
Published
()
Modified
AI analysis

GitPython versions before 3.1.58 fail to validate the options passed to the underlying git commands in IndexFile.remove() and Head.checkout(), so extra arguments such as --pathspec-from-file and --pathspec-file-nul can reach git unvalidated. An attacker who can influence the arguments to these methods can point --pathspec-from-file at any path, causing git to read that file instead of the intended pathspec (CWE-73). Because the full file contents are returned in GitCommandError.stderr, the attacker gains arbitrary file read with the privileges of the process running GitPython; the CVSS 4.0 score of 7.1 (high) reflects network access, low privileges, no user interaction, and high confidentiality impact. Any Python application or service in the pip ecosystem using an affected GitPython version and passing attacker-controlled data into IndexFile.remove() or Head.checkout() is affected, while code that hardcodes these arguments is not practically exposed. Exploitation status: one public advisory/PoC exists, EPSS is low (0.4%, 29th percentile), and the issue is not in CISA KEV, so no widespread in-the-wild exploitation is currently known.

What to do: Upgrade to GitPython 3.1.58 or later. As an interim mitigation, ensure attacker-controlled input is never forwarded as git options to IndexFile.remove() or Head.checkout() (for example, reject or escape arguments beginning with '--'), and audit application code that passes user-supplied pathspecs or arguments into these calls.

Affected
gitpython project GitPythonall versions before 3.1.58 (pip ecosystem)
Estimated exposure
mass≈1M+ installed Python environments (GitPython is a very widely used pip dependency; millions of monthly downloads) — GitPython is one of the most-downloaded Git libraries on PyPI with millions of monthly downloads and thousands of dependent applications and CI pipelines, so installations running pre-3.1.58 versions plausibly exceed one million, though…

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

Vendors
gitpython project
Products
gitpython
Ecosystems
pip
Weakness
CWE-73
Vector
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/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-hh9p-6wh2-4mfc (medium)

In the news

No ingested article mentions this CVE yet.