CVE-2026-78678
PoC largeArgument Injection in GitPython Repo.blame() Enables Arbitrary File Read
GitPython versions before 3.1.59 ship an incomplete denylist in the unsafe_git_revision_options guard, which fails to block the --contents and -S options when validating revision arguments (CWE-88). An attacker who can control the revision value passed to Repo.blame() can inject options such as --contents=/etc/passwd, causing git blame to read that file and return its contents through the blame result to the caller. The impact is arbitrary file reading on the host running the affected Python process, with high confidentiality impact but no integrity or availability impact (CVSS 4.0: 7.1 high). Any pip-based application using a vulnerable GitPython version is affected, but only those that forward attacker-controlled revision strings to Repo.blame() are actually exploitable. There is no known in-the-wild exploitation yet (EPSS 0.2%, not in CISA KEV), though a public security advisory with a proof-of-concept reference has been published, and the flaw is fixed in version 3.1.59.
What to do: Upgrade to GitPython 3.1.59 or later via pip. As an interim mitigation, audit code for Repo.blame() calls that accept external input and reject revision values that begin with a dash or contain option-like tokens such as --contents or -S before passing them to git. The fix is in the library itself, so any application pinning GitPython below 3.1.59 in requirements files or lockfiles should be updated and redeployed.
| gitpython project GitPython | all versions before 3.1.59 (pip ecosystem) |
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.59 contain an incomplete denylist in the unsafe_git_revision_options guard that omits --contents and -S options, allowing attackers to read arbitrary files by passing these options to Repo.blame(). Attackers can supply revision values like --contents=/etc/passwd to leak file contents through the blame result returned to the caller.
- 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: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-5xxx-qhh7-9287 (medium)
In the news0 stories
No ingested article mentions this CVE yet.