---
id: CVE-2026-73621
title: GitPython before 3.1.56 Arbitrary File Truncation via Commit.count
summary: >-
  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 att…
severity: medium
cvss: 5.4
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L'
cvssSource: cna
cwe:
  - CWE-88
vendor: gitpython-developers
product: GitPython
affected:
  - GitPython < 3.1.56
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-08-14T18:02:51.509040Z'
published: '2026-08-13'
updated: '2026-10-08'
sourceUpdated: '2026-10-08T15:24:41.812Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-73621'
references:
  - url: >-
      https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-p538-c434-8v24
    label: GitHub Security Advisory (GHSA-p538-c434-8v24)
  - url: >-
      https://www.vulncheck.com/advisories/gitpython-before-arbitrary-file-truncation-via-commit-count
    label: >-
      VulnCheck Advisory: GitPython before 3.1.56 Arbitrary File Truncation via
      Commit.count
  - url: 'https://github.com/gitpython-developers/GitPython/pull/2184'
  - url: >-
      https://github.com/gitpython-developers/GitPython/commit/38553b6fddc7f6a667cdb45a6762343a08fc72b2
  - url: 'https://github.com/gitpython-developers/GitPython'
  - url: 'https://github.com/gitpython-developers/GitPython/releases/tag/3.1.56'
tags:
  - cve.org
  - osv
  - pip
epss: 0.0036
epssPercentile: 0.29633
aliases:
  - GHSA-p538-c434-8v24
  - PYSEC-2026-3950
ecosystem: pip
patched:
  - gitpython 3.1.56
ingestedAt: '2026-08-14T19:18:45.627Z'
---

## Overview

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).

## Affected

- `GitPython < 3.1.56`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-73621)

Affected packages:

- `gitpython < 3.1.56`

Patched in:

- `gitpython 3.1.56`

Source: https://osv.dev/vulnerability/GHSA-p538-c434-8v24
