# CVE-2026-67323: GitPython command injection via unguarded Git options

Source: https://junglewise.ai/threats/cve-2026-67323-gitpython-command-injection-via-unguarded-git-options  
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-67323 · Severity: high · CVSS 8.4 · Published 2026-08-01

GitPython is a library that allows applications to interact with Git repositories. Multiple methods in GitPython (Repo.archive(), git.ls_remote(), Repo.iter_commits(), and Repo.blame()) fail to properly validate user-supplied arguments, allowing attackers to inject dangerous Git command-line options. An attacker who can control the arguments passed to these methods can execute arbitrary commands on the system or overwrite arbitrary files.

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-67323 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-67323 being exploited in the wild.

**How severe is CVE-2026-67323?** High severity, with a CVSS score of 8.4, 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-67323?** 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-67323 attacked?** It is attacked with local access.

**Am I affected by CVE-2026-67323?** 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 vulnerability involves two distinct command injection flaws in GitPython's Git command construction. First, Repo.archive() and git.ls_remote() pass keyword arguments (kwargs) directly to Git without sanitization—options like --exec and --upload-pack are transformed by transform_kwarg() and placed before the -- separator, allowing an attacker to inject these dangerous options and achieve arbitrary command execution. Second, Repo.iter_commits() and Repo.blame() place revision arguments before the -- separator without checking for leading-dash options, so a malicious revision like --output=/path/to/file causes Git to truncate arbitrary files before validating the revision itself. The vulnerability requires an application that passes attacker-controlled data to these methods. The issue was already known for fetch/pull/push/clone_from (CVE-2026-42215), but these methods were missed. A fix is available in GitPython 3.1.51 and later.

## Affected products

- GitPython GitPython before 3.1.51

## Identifiers

- CVE-2026-67323
- GHSA-956x-8gvw-wg5v
- PYSEC-2026-3839

## Timeline

- 2026-07-12: disclosed: GitHub Security Advisory GHSA-956x-8gvw-wg5v published
- 2026-07-12: patched: Fix released in GitPython 3.1.51

## References

- [https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-956x-8gvw-wg5v](https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-956x-8gvw-wg5v)
- [https://www.vulncheck.com/advisories/gitpython-before-command-injection-via-unguarded-git-options](https://www.vulncheck.com/advisories/gitpython-before-command-injection-via-unguarded-git-options)

## 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)
