CVE-2026-78678: GitPython arbitrary file read in Repo.blame via incomplete option denylist

CVE-2026-78678 · Severity: medium · CVSS 6.5 · Published 2026-08-25

GitPython's Repo.blame() function is used by applications to query source code authorship and commit history. The function has an input validation check intended to block dangerous Git command-line options, but the allowlist is incomplete—it blocks write operations (--output) but not read operations (--contents, -S). An attacker controlling the revision parameter can inject these options to read arbitrary files on the system as the process owner, with results leaked back to the caller.

Technologies: Gitpython Project Gitpython, gitpython (PyPI). Vendors: Gitpython Project, PyPI.

Quick answers

Is CVE-2026-78678 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-78678 being exploited in the wild.
How severe is CVE-2026-78678?
Medium severity, with a CVSS score of 6.5, published 25 August 2026.
Which products and versions are affected?
gitpython (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.59.
Is there a fix for CVE-2026-78678?
Yes. gitpython (PyPI): upgrade to 3.1.59 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-78678 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-78678?
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.59 or later
    pip install "gitpython>=3.1.59"

Technical details

The vulnerability is an incomplete option denylist in the unsafe_git_revision_options guard used by Repo.blame() and Repo.blame_incremental(). The denylist contains only ["--output", "-o"], which block file writes. However, the `git blame` command also honors --contents <file> and -S <file> options that cause the specified file's lines to be echoed into the blame output—enabling arbitrary file READ. Neither option appears in the denylist. When an attacker-controlled revision string containing --contents=/etc/passwd is passed to blame(), the check_unsafe_options() guard fails to block it (the canonical name "contents" is not in the denylist), and the option is passed unsanitized to the git command, placing it before the -- separator. The file's line contents appear in the returned blame result. The attack requires the caller to forward user-influenced revision values to blame(); no authentication or user interaction is needed. Patched in version 3.1.59.

Affected products

  • GitPython GitPython <= 3.1.58

Identifiers

  • CVE-2026-78678
  • GHSA-5xxx-qhh7-9287
  • PYSEC-2026-3788

Timeline

  • 2026-09-08: disclosed
  • 2026-09-08: patched: Fixed in version 3.1.59

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.