DEV Community

CVE Reports
CVE Reports

Posted on • Originally published at cvereports.com

GHSA-3F7W-8RR8-F37F: GHSA-3f7w-8rr8-f37f: Arbitrary File Overwrite and Read via Unguarded Argument Forwarding in GitPython

GHSA-3f7w-8rr8-f37f: Arbitrary File Overwrite and Read via Unguarded Argument Forwarding in GitPython

Vulnerability ID: GHSA-3F7W-8RR8-F37F
CVSS Score: 8.1
Published: 2026-08-03

An argument injection vulnerability in GitPython allows remote or local attackers to execute arbitrary file reads or arbitrary file overwrites via unsafe command option forwarding. This occurs because the wrapper methods IndexFile.checkout() and TagReference.create() fail to validate parameters before passing them to system-level git invocations.

TL;DR

GitPython versions prior to 3.1.57 are vulnerable to argument injection, enabling arbitrary file overwrite via IndexFile.checkout() and arbitrary file read via TagReference.create() because keyword arguments are forwarded unsanitized to the underlying git binary.


⚠️ Exploit Status: POC

Technical Details

  • CWE ID: CWE-88 (Argument Injection), CWE-20 (Improper Input Validation)
  • Attack Vector: Network
  • CVSS Score: 8.1
  • Impact: High (Arbitrary File Overwrite / Arbitrary File Read)
  • Exploit Status: Proof-of-Concept Available
  • KEV Status: Not Listed

Affected Systems

  • GitPython
  • gitpython: < 3.1.57 (Fixed in: 3.1.57)

Code Analysis

Commit: 3af0c25

Reject unsafe options in IndexFile.checkout and TagReference.create

Mitigation Strategies

  • Upgrade GitPython to version 3.1.57 or newer to enforce default parameter validation blocklists.
  • Sanitize application-level inputs to ensure keys like 'prefix', 'F', and 'file' are stripped from user-controlled dictionary unpacking before passing arguments to GitPython methods.
  • Apply the principle of least privilege by running repository-parsing applications within isolated, non-root user accounts or containerized environments.

Remediation Steps:

  1. Identify all direct dependencies on GitPython within requirements files or package lock files.
  2. Execute the package manager update command: pip install --upgrade gitpython>=3.1.57.
  3. Search the codebase for usages of IndexFile.checkout() and TagReference.create() to ensure no manual enablement of allow_unsafe_options=True exists without proper sanitization.

References


Read the full report for GHSA-3F7W-8RR8-F37F on our website for more details including interactive diagrams and full exploit analysis.

Top comments (0)