CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-3F7W-8RR8-F37F

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

Alon Barad
Alon Barad
Software Engineer

Aug 4, 2026·5 min read·2 visits

Executive Summary (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.

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.

Vulnerability Overview

GitPython is a Python library used to interact with Git repositories by abstracting command-line operations into Pythonic APIs. The library provides high-level classes such as IndexFile and TagReference to manage git indexes and reference tags respectively. When these classes perform actions, they serialize programmatic options and dispatch execution to the local system's git binary.

The attack surface exists within any API wrapper that passes developer-controlled keyword arguments directly to the underlying shell command execution. By default, GitPython features an opt-in parameter validation system called Git.check_unsafe_options(). However, because this verification is not enforced globally at the execution dispatcher layer, any API wrapper that omits the validation remains completely unguarded.

Two critical wrapper methods are vulnerable to this design pattern. The IndexFile.checkout() method forwards arguments to git checkout-index, which accepts the --prefix option to redirect file creation outside the workspace. The TagReference.create() method forwards arguments to git tag, which accepts the -F or --file options to read local system files and return them in-band. This leads to arbitrary file write (integrity and availability compromise) and arbitrary file read (confidentiality compromise).

Root Cause Analysis

The root cause of this vulnerability lies in improper validation of command-line arguments, classified under CWE-88 (Argument Injection) and CWE-20 (Improper Input Validation). GitPython relies on individual, opt-in implementations of Git.check_unsafe_options() inside wrapper functions to maintain security. If a wrapper accepts **kwargs and passes them directly to the git command execution without sanitization, an attacker who controls the arguments can inject system flags.

In IndexFile.checkout(), the python method forwards arguments to git checkout-index. The --prefix=<path> command-line option specifies a prefix directory to prepend to checked-out paths. Because there is no check preventing the use of --prefix, an attacker can specify absolute directories or directory traversal sequences. This allows the application to write files from the repository to arbitrary paths on the local filesystem, overwriting existing files if run with appropriate permissions.

In TagReference.create(), the method maps to the git tag command. The command-line utility supports the -F <file> and --file=<file> options to import a tag message from a target file. Because GitPython does not filter these options, an attacker can specify a sensitive system file as the source. GitPython subsequently reads this file, associates it with the created tag object, and exposes its raw contents when the application accesses the TagReference.tag.message property.

Code Analysis

Before the patch, git/index/base.py contained the following unsafe forwarding mechanism:

def checkout(self, paths=None, force=False, fprogress=lambda *args: None, **kwargs):
    # Unsanitized kwargs are passed directly to checkout_index
    proc = self.repo.git.checkout_index(*args, **kwargs)

Because there is no invocation of Git.check_unsafe_options() or defined blocked option list, any keys in kwargs are converted directly into command-line arguments. For example, passing prefix='/tmp/' evaluates to --prefix=/tmp/ in the shell execution.

Similarly, git/refs/tag.py contained the following definition:

def create(cls, repo, path, reference="HEAD", logmsg=None, force=False, **kwargs):
    # Forwarded directly to the underlying git wrapper without verification
    # kwargs can contain 'F' or 'file' keys

To address this, the patch introduces class-level variables specifying banned options and updates the method signatures to accept allow_unsafe_options: bool = False. Inside the methods, an explicit check validates the passed arguments against the blocklist unless allow_unsafe_options is set to True:

# Inside IndexFile
unsafe_git_checkout_index_options = ["--prefix"]
 
# Validation check added to checkout()
if not allow_unsafe_options:
    Git.check_unsafe_options(
        options=Git._option_candidates([], kwargs),
        unsafe_options=self.unsafe_git_checkout_index_options,
    )

Exploitation and Proof-of-Concept

Exploitation requires the attacker to be able to supply or influence the keyword arguments (**kwargs) passed to either of the vulnerable methods. This scenario typically occurs in web applications, automated CI/CD pipelines, or repository management dashboards that accept custom execution configurations from users.

To perform an arbitrary file overwrite, an attacker invokes index.checkout() with a custom prefix argument pointing to a system target. The following proof-of-concept demonstrates how the exploit redirects repository files to write directly into /tmp/target_dir/ instead of the local repository workspace:

from git import Repo
import os
 
repo = Repo("/path/to/repo")
# Executes 'git checkout-index -a -f --prefix=/tmp/target_dir/'
repo.index.checkout(prefix="/tmp/target_dir/", a=True, f=True)

To perform an arbitrary file read, the attacker targets TagReference.create() by specifying the -F parameter with the target file path. When GitPython spawns the process, it reads the target file and records its content as the tag message. The application can then read the sensitive file content in-band:

from git import Repo
from git.refs.tag import TagReference
 
repo = Repo("/path/to/repo")
# Executes 'git tag -a -f -F /etc/passwd leak_tag'
tag_ref = TagReference.create(repo, "leak_tag", force=True, a=True, F="/etc/passwd")
leaked_data = tag_ref.tag.message
print(leaked_data)

Impact Assessment

The impact of these two primitives is high. The arbitrary file overwrite primitive enables attackers to compromise system integrity. If the application runs with root privileges or within a user directory, an attacker can overwrite critical files such as .bashrc, .ssh/authorized_keys, or configuration files, potentially escalating privileges or achieving remote code execution.

The arbitrary file read primitive directly breaks confidentiality. In automated environments, this allows attackers to leak configuration properties, local environment variables, system user information (such as /etc/passwd), or application source code. The data is returned directly to the calling context, which may output it to web interfaces or log collectors.

Because the underlying vulnerability pattern (opt-in security checks) relies on manual application on a per-wrapper basis, additional undocumented wrappers may still expose similar argument injection vectors. The CVSS score of 8.1 reflects high integrity and availability impact, though configuration-dependent confidentiality impacts are also severe.

Official Patches

gitpython-developersFix Commit
gitpython-developersPull Request

Fix Analysis (1)

Technical Appendix

CVSS Score
8.1/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H

Affected Systems

GitPython

Affected Versions Detail

Product
Affected Versions
Fixed Version
gitpython
gitpython-developers
< 3.1.573.1.57
AttributeDetail
CWE IDCWE-88 (Argument Injection), CWE-20 (Improper Input Validation)
Attack VectorNetwork
CVSS Score8.1
ImpactHigh (Arbitrary File Overwrite / Arbitrary File Read)
Exploit StatusProof-of-Concept Available
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1202Indirect Command Execution
Execution
T1059Command and Scripting Interpreter
Execution
CWE-88
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

The application constructs an OS command using keyword arguments but does not neutralize or validate elements that can modify the command's actions, leading to argument injection.

Vulnerability Timeline

Security researchers identify 14 unguarded command-execution call sites on GitPython version 3.1.55.
2026-07-25
Core developers patch the vulnerability in commit 3af0c2516c5e18c829da30338614688f6b69b49c.
2026-07-26
Official security advisory GHSA-3f7w-8rr8-f37f is published alongside library version 3.1.57.
2026-08-03

References & Sources

  • [1]GitHub Security Advisory GHSA-3f7w-8rr8-f37f
  • [2]GitPython Pull Request 2193
  • [3]GitPython Fix Commit
  • [4]GitPython Source Repository
  • [5]GitPython Release 3.1.57

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•28 minutes ago•CVE-2026-69198
6.9

CVE-2026-69198: Server-Side Request Forgery Bypass via CIDR Suffix in ip-address Library

An input validation vulnerability in the npm package `ip-address` allows unauthenticated remote attackers to bypass Server-Side Request Forgery (SSRF) protections by appending a `/0` CIDR suffix to IP address strings. This causes the library's classification helper functions to incorrectly identify internal addresses as public, external addresses, while normalization helpers resolve the address back to its internal form during network connection establishment.

Amit Schendel
Amit Schendel
0 views•6 min read
•about 2 hours ago•GHSA-539M-9XH6-Q6RR
6.5

GHSA-539m-9xh6-q6rr: Arbitrary File Read and SSRF in GitPython via Missing Argument Denylist Sanitization

An argument injection vulnerability in GitPython allows remote or local attackers with control over repository archive configuration options to retrieve arbitrary local files via native git archive commands. During clone operations, a sibling missing validation vulnerability in the clone option engine allows attackers to perform Server-Side Request Forgery via the git clone bundle-uri mechanism.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 3 hours ago•GHSA-P538-C434-8V24
7.5

GHSA-P538-C434-8V24: Arbitrary File Truncation via Argument Injection in GitPython Commit.count

GitPython prior to version 3.1.56 is vulnerable to argument injection in the Commit.count method. An attacker who controls keyword arguments passed to this method can inject arbitrary Git options, such as --output, leading to arbitrary file truncation on the host filesystem.

Amit Schendel
Amit Schendel
2 views•5 min read
•about 4 hours ago•CVE-2026-69240
9.8

CVE-2026-69240: SQL Injection Vulnerability in Sequelize ORM Oracle Dialect

A critical SQL injection vulnerability was discovered in Sequelize when configured to use the Oracle database dialect. Due to a flawed optimization design in the SQL escaping subsystem (src/sql-string.js), strings that begin with native Oracle date functions bypass standard escaping. This allows unauthenticated remote attackers to execute arbitrary SQL commands on the target database.

Alon Barad
Alon Barad
6 views•6 min read
•about 5 hours ago•CVE-2026-59881
6.9

CVE-2026-59881: Unnegotiated WebSocket RSV1 Frame Handling in aiohttp

CVE-2026-59881 is a protocol compliance and input validation vulnerability in the client-side WebSocket implementation of the aiohttp asynchronous HTTP client/server framework for Python. Prior to version 3.14.2, the framework's parser unexpectedly accepts and attempts to decompress frames containing the RSV1 bit, even when the permessage-deflate extension has not been negotiated during the initial WebSocket handshake. This violation of RFC 6455 allows a malicious or compromised server to bypass client configuration, forcing decompression routines that can lead to high CPU and memory consumption, resulting in a denial-of-service condition.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 6 hours ago•CVE-2026-69243
6.3

CVE-2026-69243: HTTP Request Smuggling via WebSocket Upgrade State Desynchronization in aiohttp

An asynchronous HTTP client/server framework for asyncio and Python, aiohttp prior to version 3.14.2 is vulnerable to HTTP Request Smuggling. The server-side HTTP parser immediately transitions the protocol state to 'upgraded' upon receiving a WebSocket upgrade request before consuming the accompanying request body. If the backend handler rejects the upgrade request while keeping the TCP connection alive, the unconsumed request body remains in the socket buffer and is parsed as a subsequent pipelined HTTP request. This allows an attacker to smuggle requests, bypass frontend reverse proxy controls, and perform unauthorized actions.

Amit Schendel
Amit Schendel
5 views•8 min read