Junglewise Threat Intelligence

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

CVE-2026-67323 · Severity: high · CVSS 8.4 · Published 2026-08-01

Technologies: Gitpython Project Gitpython. Vendors: PyPI, Gitpython Project.

Executive brief

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.

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

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

Related threats