# CVE-2026-67325: GitPython command injection via option prefix abbreviation

Source: https://junglewise.ai/threats/cve-2026-67325-gitpython-command-injection-via-option-prefix-abbreviation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-01. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-67325 · Severity: high · CVSS 8.8 · Published 2026-08-01

GitPython is a Python library used by developers to programmatically interact with Git repositories. Versions before 3.1.51 contain a flaw in their input validation that allows attackers to bypass security checks by using abbreviated git option names. An attacker who can control function parameters in an application using GitPython can execute arbitrary commands on the server running the application, potentially compromising source code, credentials, and system integrity.

Technologies: [Gitpython Project Gitpython](https://junglewise.ai/threats/technologies/gitpython), [gitpython (PyPI)](https://junglewise.ai/threats/technologies/pypi-gitpython). Vendors: [Gitpython Project](https://junglewise.ai/threats/vendors/gitpython-project), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-67325 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-67325 being exploited in the wild.

**How severe is CVE-2026-67325?** High severity, with a CVSS score of 8.8, published 1 August 2026.

**Which products and versions are affected?** gitpython (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.51.

**Is there a fix for CVE-2026-67325?** Yes. gitpython (PyPI): upgrade to 3.1.51 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-67325 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-67325?** Check whether you run Gitpython Project Gitpython or gitpython (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- gitpython (PyPI): upgrade to 3.1.51 or later

  ```sh
  pip install "gitpython>=3.1.51"
  ```


## Technical details

This is an OS command injection vulnerability (CWE-78) rooted in an incomplete blocklist (CWE-184). The vulnerable code's _canonicalize_option_name() function normalizes option names by converting underscores to hyphens and performs exact-match lookup against a dictionary of dangerous options (--upload-pack, --receive-pack, --exec, --config, etc.). However, it fails to account for git's unambiguous long-option prefix abbreviation feature: git accepts any unambiguous prefix of a long option (e.g., --upload-p, --upload-pa, or --upload-pac all resolve to --upload-pack). An attacker can bypass the blocklist by passing abbreviated kwarg keys like upload_p, which canonicalize to upload-p, miss the exact-match check, and are emitted to git as --upload-p=&lt;value&gt;, where git expands them to dangerous options. Attack vector requires network access and authenticated user interaction with a host application that flows attacker-controlled kwarg keys into GitPython clone/fetch/pull/push calls with default allow_unsafe_options=False. Exploitation results in arbitrary command execution. Patch available in GitPython 3.1.51.

## Affected products

- GitPython Contributors GitPython before 3.1.51

## Identifiers

- CVE-2026-67325
- GHSA-2f96-g7mh-g2hx
- PYSEC-2026-3836

## Timeline

- 2026-07-12: disclosed
- 2026-07-12: patched: Version 3.1.51 released

## References

- [https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-2f96-g7mh-g2hx](https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-2f96-g7mh-g2hx)
- [https://www.vulncheck.com/advisories/gitpython-before-command-injection-via-option-prefix-abbreviation](https://www.vulncheck.com/advisories/gitpython-before-command-injection-via-option-prefix-abbreviation)

## Related threats

- [GitPython command wrappers omit unsafe protocol and option checks](https://junglewise.ai/threats/cve-2026-110857-gitpython-command-wrappers-omit-unsafe-protocol-and-option)
- [GitPython submodule path traversal to arbitrary hook execution](https://junglewise.ai/threats/cve-2026-114145-gitpython-is-a-python-library-used-to-interact-with-git)
- [GitPython symlink following in Submodule.move()](https://junglewise.ai/threats/cve-2026-110860-gitpython-from-3-1-62-before-3-2-0-contains-a-symlink-following)
- [GitPython argument injection in Head.checkout()](https://junglewise.ai/threats/cve-2026-110859-gitpython-before-3-2-0-contains-an-argument-injection)
- [GitPython remote code execution in Remote.pull() refspec argument](https://junglewise.ai/threats/cve-2026-110858-gitpython-from-3-1-30-before-3-2-0-contains-a-remote-code)
