Junglewise Threat Intelligence

CVE-2026-78679: GitPython TagReference.create argument injection bypasses file-read guard

CVE-2026-78679 · Severity: medium · CVSS 6.5 · Published 2026-09-08

Executive brief

GitPython is a widely-used library for interacting with Git repositories programmatically. A flaw in the TagReference.create() method allows an attacker who controls the `reference` parameter to inject Git command-line options—specifically `--file`—to read arbitrary files on the host system. The vulnerability exists because the fix for a prior related issue only guarded keyword arguments, not positional ones. In vulnerable applications that pass user input directly to TagReference.create(), an attacker can exfiltrate sensitive files (such as SSH keys or credentials) by creating a specially-crafted tag request.

Technical details

The vulnerability is an argument-injection flaw (CWE-88) in GitPython's TagReference.create() method. The fix for CVE-2026-42215 (commit 3af0c251) added an unsafe-options guard but passed an empty args list to Git._option_candidates([], kwargs), meaning the guard only inspected keyword arguments. However, the `reference` and `path` parameters are passed as positional arguments to the internal git.tag() call. A user-controlled reference value like `reference="--file=/etc/passwd"` reaches the git command line unfiltered, allowing the attacker to inject the `--file` flag that should be blocked. The annotated tag message is then populated with the file's contents, enabling arbitrary file read at the process privileges. Exploitation requires the embedding application to forward caller-influenced values into TagReference.create(); default allow_unsafe_options=False provides no protection against this bypass. Fixed in GitPython 3.1.59.

Affected products

  • GitPython GitPython <= 3.1.58

Timeline

  • 2026-09-08: disclosed: Published to GitHub Advisory Database
  • 2026-09-08: patched: GitPython 3.1.59 released with fix (commit 1b0d2d9)
  • 2026-08-10: advisory: Initial advisory published
  • 2026-09-08: other: GitHub reviewed advisory

References