GitPython incomplete denylist argument injection in Repo.blame()

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

GitPython is a popular Python library for interacting with Git repositories. The Repo.blame() method is used to retrieve authorship information for file lines. This vulnerability allows an attacker with the ability to influence revision parameters to read arbitrary files from the system where GitPython runs, bypassing the library's security checks and potentially exposing sensitive configuration files, credentials, or other confidential data.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Medium severity, with a CVSS score of 6.5, published 25 August 2026.
Which products and versions are affected?
GitPython GitPython <=3.1.58.
Is there a fix for This vulnerability?
A patch was published on 2026: GitPython 3.1.59 includes fix to expand denylist Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether anything you run is named in the advisory. 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.

Technical details

The vulnerability is a classic argument injection (CWE-88) flaw in the unsafe_git_revision_options denylist used to guard git command construction. The denylist only blocks --output and -o options (file WRITE), but omits --contents and -S (file READ) git blame options. When a caller passes a revision value like "--contents=/etc/passwd" to Repo.blame() or Repo.blame_incremental(), the option bypasses the guard check because the canonical option name is not in the denylist. The revision string is placed before the -- separator in the git command, allowing arbitrary file reads. The attacker requires the ability to control the revision parameter (low privilege requirement) and the application must call blame() with untrusted input. GitPython &lt;= 3.1.58 is affected; patched in version 3.1.59.

Affected products

  • GitPython GitPython <=3.1.58

Timeline

  • 2026-08-25: disclosed: Published in GitHub Advisory Database (GHSA-89ff-m8wv-p99r)
  • 2026: patched: GitPython 3.1.59 includes fix to expand denylist
  • 2026-09-08: other: GHSA-89ff-m8wv-p99r withdrawn as duplicate of GHSA-5xxx-qhh7-9287

References

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