Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

GitPython: Unguarded git option forwarding in IndexFile.checkout() and TagReference.create() enables arbitrary file overwrite and arbitrary file read

0
High
Published: 08/03/2026 (08/03/2026, 20:09:56 UTC)
Source: GCVE Database
Product: GitPython

Description

GitPython versions prior to 3.1.57 contain unguarded forwarding of git command options in the methods IndexFile.checkout() and TagReference.create(). This allows an attacker with limited privileges to cause arbitrary file overwrite on the filesystem via the --prefix option in git checkout-index, and arbitrary file read via the -F/--file option in git tag. Both vulnerabilities arise because these methods forward **kwargs directly to git commands without validating or restricting unsafe options. The arbitrary file overwrite can lead to code execution if attacker-controlled repository content is written to sensitive locations. The arbitrary file read exposes file contents to the attacker at the process privilege level. A patch is available to address these issues.

CVSS v3.1

Score 8.1high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H

Affected software

PyPIghsa
GitPython
Affected versions
<3.1.57

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/03/2026, 21:24:24 UTC

Technical Analysis

GitPython's IndexFile.checkout() and TagReference.create() methods forward caller-controlled keyword arguments directly to underlying git commands without applying the intended safety checks via Git.check_unsafe_options(). This allows exploitation of git options that accept filesystem paths. Specifically, IndexFile.checkout() forwards **kwargs to 'git checkout-index', enabling an attacker to specify the --prefix option to write repository-controlled files to arbitrary locations on the filesystem, potentially overwriting critical files. TagReference.create() forwards **kwargs to 'git tag', allowing the use of the -F/--file option to read arbitrary files on the filesystem, with contents returned in-band via the tag message. These vulnerabilities are present in GitPython versions before 3.1.57 and have a CVSS 3.1 score of 8.1 (High). The issues are similar in nature to previously fixed defects in other GitPython methods but remain unpatched in these two call sites at the time of reporting. A fix is available.

Potential Impact

An attacker with the ability to influence repository content or invoke these GitPython APIs can overwrite arbitrary files on the filesystem with repository-controlled data, potentially leading to code execution under the service account. This is due to the unchecked --prefix option in 'git checkout-index'. Additionally, the attacker can read arbitrary files on the filesystem via the unchecked -F/--file option in 'git tag', exposing sensitive information at the process privilege level. These impacts are significant given the potential for privilege escalation and data disclosure.

Mitigation Recommendations

A patch is available for GitPython that addresses these vulnerabilities by adding proper validation and guarding of unsafe git options in the affected methods. Users should upgrade to version 3.1.57 or later. Until patched, avoid passing untrusted input through the affected methods' **kwargs parameters or use alternative safe APIs. Review and restrict usage of IndexFile.checkout() and TagReference.create() to trusted contexts only.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-3f7w-8rr8-f37f
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["PyPI"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a710652bf32cb7a34392ed8

Added to database: 08/03/2026, 21:21:22 UTC

Last enriched: 08/03/2026, 21:24:24 UTC

Last updated: 08/04/2026, 01:32:29 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses