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: Unsafe git option guard bypass via split_single_char_options=False short-option token smuggling enables command execution

0
High
Published: 08/07/2026 (08/07/2026, 15:49:07 UTC)
Source: GCVE Database
Product: GitPython

Description

GitPython versions up to 3.1.57 contain a vulnerability where the unsafe git option guard can be bypassed by using the split_single_char_options=False flag combined with a single-character keyword argument. This allows an attacker to smuggle a short option token that leads to arbitrary OS command execution via the git --upload-pack option. The vulnerability affects all guarded methods that forward kwargs and occurs despite the default allow_unsafe_options=False setting. A patch is available to fix this issue.

CVSS v3.1

Score 8.8high

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

Affected software

PyPIghsa
GitPython
Affected versions
<3.1.58

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/08/2026, 15:40:58 UTC

Technical Analysis

The vulnerability arises because the _option_candidates function only derives value-token candidates when split_single_char_options is True. When set to False, the guard's candidate list omits the smuggled option, allowing the transform_kwarg function to emit a joined token that git interprets as a --upload-pack command, enabling arbitrary command execution. This bypasses the existing unsafe option guard implemented in commit e8d0fbf7, which only checks candidates when split_single_char_options is True. The flaw affects all guarded GitPython methods that forward kwargs and use split_single_char_options=False with a single-character key. The vulnerability is present in GitPython versions up to and including 3.1.57.

Potential Impact

An attacker who can control kwargs passed to GitPython methods such as clone, fetch, pull, push, ls_remote, iter_commits, blame, or archive and set split_single_char_options=False with a crafted single-character option can achieve arbitrary OS command execution on the host running the GitPython process. This occurs despite the default allow_unsafe_options=False setting, as the unsafe option guard is bypassed due to incomplete candidate detection. The impact includes full confidentiality, integrity, and availability compromise of the host system via command execution.

Mitigation Recommendations

A patch is available that corrects the _option_candidates function to emit value-derived candidates regardless of the split_single_char_options flag, or alternatively runs the unsafe option guard over the fully transformed argv tokens rather than the reconstructed candidate list. Users should upgrade GitPython to version 3.1.58 or later where this issue is fixed. Until patched, avoid passing split_single_char_options=False with user-controlled single-character kwargs to guarded GitPython methods.

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-wvpp-8hx9-p66j
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["PyPI"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a77432fbf8831d539b4628c

Added to database: 08/08/2026, 14:54:39 UTC

Last enriched: 08/08/2026, 15:40:58 UTC

Last updated: 08/09/2026, 00:43:20 UTC

Views: 8

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