Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. GitPython
  4. ›
  5. GHSA-p538-c434-8v24

GHSA-p538-c434-8v24: GitPython: Arbitrary file truncation via git rev-list --output argument injection in unguarded Commit.count

August 3, 2026

Commit.count() forwards **kwargs into rev_list with no check_unsafe_options guard (the guard exists only in the sibling iter_items, commit.py:341). git rev-list --output=<path> opens and truncates the target file to 0 bytes before revision parsing, so count(output='/victim') destroys/blanks an arbitrary file.

References

  • github.com/advisories/GHSA-p538-c434-8v24
  • github.com/gitpython-developers/GitPython/commit/38553b6fddc7f6a667cdb45a6762343a08fc72b2
  • github.com/gitpython-developers/GitPython/pull/2184
  • github.com/gitpython-developers/GitPython/releases/tag/3.1.56
  • github.com/gitpython-developers/GitPython/security/advisories/GHSA-p538-c434-8v24

Code Behaviors & Features

Detect and mitigate GHSA-p538-c434-8v24 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.1.56

Fixed versions

  • 3.1.56

Solution

Upgrade to version 3.1.56 or above.

Impact 5.4 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L

Learn more about CVSS

Weakness

  • CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

Source file

pypi/GitPython/GHSA-p538-c434-8v24.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 05 Aug 2026 12:27:55 +0000.