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).
Published: 2026-08-13
Score: 5.3 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

No advisories yet.

History

Thu, 13 Aug 2026 14:30:00 +0000

Type Values Removed Values Added
First Time appeared Gitpython-developers
Gitpython-developers gitpython
Vendors & Products Gitpython-developers
Gitpython-developers gitpython

Thu, 13 Aug 2026 11:45:00 +0000

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'}


Subscriptions

Gitpython-developers Gitpython
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-13T11:28:22.108Z

Reserved: 2026-08-13T11:17:25.160Z

Link: CVE-2026-73621

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-13T12:17:27.200

Modified: 2026-08-13T12:17:27.200

Link: CVE-2026-73621

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T14:15:04Z

Weaknesses
  • CWE-88

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