CVE-2026-73621: GitPython argument injection in Commit.count

CVE-2026-73621 · Severity: medium · CVSS 5.4 · Published 2026-08-13

GitPython is a widely-used Python library for interacting with Git repositories. The Commit.count() method contains a flaw that allows attackers who can control the options passed to this method to truncate arbitrary files to zero bytes on the system. This could be exploited by applications that forward user-supplied options to GitPython, potentially destroying critical data or disrupting operations.

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

Quick answers

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

Technical details

The vulnerability is an argument injection flaw (CWE-88) in the Commit.count() method, which forwards keyword arguments directly to the git rev-list command without applying the check_unsafe_options guard that exists in the sibling iter_items() method. An attacker who can control the kwargs passed to count() can inject output=<path>, causing git rev-list --output=<path> to open and truncate the target file to zero bytes before revision parsing. The attack requires the ability to influence options passed to Commit.count() (e.g., via an application that forwards a user-supplied options dict), and results in 0-byte file truncation at the process's privilege level with no content control. The fix is available in GitPython 3.1.56 and later.

Affected products

  • GitPython GitPython before 3.1.56

Identifiers

  • CVE-2026-73621
  • GHSA-p538-c434-8v24
  • PYSEC-2026-3950

Timeline

  • 2026-07-25: disclosed
  • 2026-08-13: advisory
  • 2026: patched: Version 3.1.56 and later contain the fix

References

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