legit · GitPython: Arbitrary file truncation via git rev-list --output argument injection in unguarded Commit.count
Affects legitSource GCVE Database
Not known to be exploited · CVSS 5.3 Medium : upgrade to 1.2.0.post0_13 when convenient.
Data as of 26 Oct 2026, 19:12 UTC
- Patch
- Available – fixed in 1.2.0.post0_13
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 13 Aug 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade legit to 1.2.0.post0_13.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Homebrewlegitpkg:brew/legitOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available in GitPython version 1.2.0.post0_13 that adds the necessary safety checks to Commit.count(). Users should upgrade to this version or later to remediate the vulnerability. Until patched, avoid passing untrusted input to Commit.count() keyword arguments, especially the output parameter.
Description
GitPython versions up to 3.1.53 contain a vulnerability in the Commit.count() method where unguarded forwarding of keyword arguments to git rev-list allows arbitrary file truncation. Specifically, using the output argument causes git rev-list to open and truncate the specified file to zero bytes before processing, enabling destruction of arbitrary files with the process's privileges. This vulnerability has a medium severity impact due to the integrity and availability loss but limited reachability and no content control over the truncation.
References
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-p538-c434-8v24 (opens in a new tab)
- github.com/gitpython-developers/GitPython/pull/2184 (opens in a new tab)
- github.com/gitpython-developers/GitPython/commit/38553b6fddc7f6a667cdb45a6762343a08fc72b2 (opens in a new tab)
- github.com/gitpython-developers/GitPython (opens in a new tab)
- github.com/gitpython-developers/GitPython/releases/tag/3.1.56 (opens in a new tab)