CVE-2026-67325: GitPython · Command Injection via git long-option prefix abbreviation bypass of CVE-2026-42215 blocklist
Affects GitPythonSource GCVE Database
Mentioned vulnerabilities
CVSS 8.8 High : upgrade to 3.1.51 soon.
Data as of 26 Oct 2026, 16:10 UTC
- Patch
- Available – fixed in 3.1.51
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HWhat to do
Upgrade GitPython to 3.1.51.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIGitPython | 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
If you cannot patch yet, users should avoid passing untrusted or attacker-controlled keyword argument keys to GitPython's clone, fetch, pull, or push methods. The vulnerability is a bypass of the existing blocklist, so relying on allow_unsafe_options=False alone is insufficient. Monitoring for updates from the GitPython maintainers and applying any forthcoming official fixes is recommended.
Description
GitPython contains a command injection vulnerability due to incomplete blocking of unsafe git options. The fix for CVE-2026-42215 implemented a blocklist for dangerous git options but did not account for git's acceptance of unambiguous long-option prefix abbreviations. This allows attackers to bypass the blocklist by using abbreviated option keys, leading to command injection when GitPython emits these options to git commands. The vulnerability affects all versions carrying the 3.1.47 blocklist fix through versions before 3.1.51. Exploitation requires a host application that passes attacker-controlled keyword argument keys to GitPython's clone, fetch, pull, or push methods. The severity is high, reflecting potential remote code execution impact.
References
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-2f96-g7mh-g2hx (opens in a new tab)
- github.com/gitpython-developers/GitPython/pull/2161 (opens in a new tab)
- github.com/gitpython-developers/GitPython/commit/56806080c1348749b07daa4a2024ce47b3cad285 (opens in a new tab)
- github.com/gitpython-developers/GitPython (opens in a new tab)
- github.com/gitpython-developers/GitPython/releases/tag/3.1.51 (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-67325 (opens in a new tab)
- vulncheck.com/advisories/gitpython-before-command-injection-via-option-prefix-abbreviation (opens in a new tab)