CVE-2026-73621

GitPython before 3.1.56 Arbitrary File Truncation via Commit.count

Published Aug 13, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
GitPython before 3.1.56 contains an argument injection vulnerability in the Commit.count() method, which forwards keyword arguments to 'git rev-list' without the check_unsafe_options guard present in the sibling iter_items method. An attacker who can control options passed to Commit.count (e.g., via an application that forwards a user-supplied options dict) can supply output=<path>, causing 'git rev-list --output=<path>' to open and truncate the target file to zero bytes before revision parsing. This allows destruction/blanking of an arbitrary file at the process's privilege level (no content control, 0-byte truncation).

Analysis

AI-generated

Technical impact

The vulnerability resides in GitPython versions prior to 3.1.56, where the Commit.count() method forwards user-controlled keyword arguments directly to the underlying 'git rev-list' command without applying the safety guard that the related iter_items method uses. An attacker who can supply a custom options dictionary—such as an application that passes user data to Commit.count—may include the option output=<path>. This causes the invoked git command to open the specified file and truncate it to zero bytes before any revision parsing occurs. Consequently, an arbitrary file located anywhere in the process’s file system can be destroyed or blanked, affecting confidentiality and integrity of data at the level of the running process."

Affected Systems

The affected software is GitPython distributed by the gitpython-developers community. Vulnerable before version 3.1.56; all earlier releases are impacted. Subsequent versions, starting with 3.1.56, have the safety guard added and are not affected.

Risk and Exploitability

The CVSS score of 5.3 rates the vulnerability as moderate in severity. No EPSS score is published, and the vulnerability is not listed in the CISA KEV catalog, indicating no known active exploitation. The likely attack vector is local or remote code execution within an application that uses GitPython and passes unchecked options to Commit.count. Without privilege escalation, the damage is limited to files that the process can overwrite, but the absence of content control means a 0-byte truncation can cause significant data loss or application failure.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to GitPython 3.1.56 or later, which reinstates the check_unsafe_options guard on Commit.count.
  • Modify application code to avoid forwarding arbitrary user-supplied options to Commit.count; validate or whitelist acceptable parameters.
  • If an upgrade is not immediately possible, patch the library locally to enforce safe options or strip the 'output' key before invoking Commit.count.

Generated by OpenCVE AI on August 13, 2026 at 12:44 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4872-1 python-git security update
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Gitpython Project
Gitpython Project gitpython
CPEs cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:*
Vendors & Products Gitpython Project
Gitpython Project gitpython
Type Values Removed Values Added
First Time appeared Gitpython-developers
Gitpython-developers gitpython
Vendors & Products Gitpython-developers
Gitpython-developers gitpython
Type Values Removed Values Added
Description GitPython before 3.1.56 contains an argument injection vulnerability in the Commit.count() method, which forwards keyword arguments to 'git rev-list' without the check_unsafe_options guard present in the sibling iter_items method. An attacker who can control options passed to Commit.count (e.g., via an application that forwards a user-supplied options dict) can supply output=<path>, causing 'git rev-list --output=<path>' to open and truncate the target file to zero bytes before revision parsing. This allows destruction/blanking of an arbitrary file at the process's privilege level (no content control, 0-byte truncation).
Title GitPython before 3.1.56 Arbitrary File Truncation via Commit.count
Weaknesses CWE-88
References
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L'}

cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-88

    Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 8, 2026, 3:24 PM
Reserved
Aug 13, 2026, 11:17 AM
Status
Analyzed
Published
Aug 13, 2026, 12:17 PM
Modified
Oct 24, 2026, 3:10 PM
Severity
Moderate
Public date
Aug 13, 2026, 11:28 AM