GitPython unsafe clone option gate bypass through joined short options
GitPython version 3.1.50 contains a vulnerability where the default unsafe option gate intended to block dangerous git clone options does not recognize joined short-option forms such as '-u<value>'. This allows an attacker controlling clone options to bypass the safety check and execute local commands via Git's --upload-pack/-u option. The issue arises because the option canonicalization treats '-u<value>' as a different option name, allowing execution despite allow_unsafe_options being false. The vulnerability affects the PyPI package GitPython at version 3.1.50.
AI Analysis
Technical Summary
GitPython 3.1.50 attempts to block unsafe git clone options like --upload-pack (-u) by default unless allow_unsafe_options=True is set. However, the implementation does not properly canonicalize joined short options that take values, such as '-u/path/to/helper'. Git itself accepts '-u<upload-pack>' as equivalent to '--upload-pack=<upload-pack>', executing the helper command. GitPython's check splits multi_options but canonicalizes '-u<value>' to 'u<value>', which does not match the blocked 'u' option, allowing execution of the helper command despite the safety gate. This is a residual bypass of the explicit security boundary in GitPython's clone method. The vulnerability requires an attacker to control the multi_options argument passed to Repo.clone_from and relies on GitPython's default blocking behavior. The issue is confirmed with a local proof of concept that shows the helper script execution despite allow_unsafe_options=False. No patch or official fix is currently documented for this specific bypass in version 3.1.50.
Potential Impact
An attacker who can influence the multi_options parameter in GitPython's Repo.clone_from can bypass the default protection that blocks unsafe git clone options. This allows execution of arbitrary local commands via Git's --upload-pack/-u option during a clone operation. This bypass circumvents an explicit security boundary designed to prevent command execution without explicit allowance, potentially leading to local command execution in the context of the application using GitPython. The clone operation itself may fail if the helper exits nonzero, but the command execution side effect occurs, which could be leveraged for malicious purposes.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The suggested remediation is for GitPython to properly parse and canonicalize joined short options that take values (e.g., '-uVALUE' and '-cKEY=VALUE') to their base short option names before checking against the unsafe option set. Until a fix is released, users should avoid passing untrusted input to the multi_options parameter in Repo.clone_from or explicitly set allow_unsafe_options=True only when safe. Monitoring GitPython repository advisories and updates for a fix addressing this joined short option bypass is recommended.
GitPython unsafe clone option gate bypass through joined short options
Description
GitPython version 3.1.50 contains a vulnerability where the default unsafe option gate intended to block dangerous git clone options does not recognize joined short-option forms such as '-u<value>'. This allows an attacker controlling clone options to bypass the safety check and execute local commands via Git's --upload-pack/-u option. The issue arises because the option canonicalization treats '-u<value>' as a different option name, allowing execution despite allow_unsafe_options being false. The vulnerability affects the PyPI package GitPython at version 3.1.50.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
GitPython 3.1.50 attempts to block unsafe git clone options like --upload-pack (-u) by default unless allow_unsafe_options=True is set. However, the implementation does not properly canonicalize joined short options that take values, such as '-u/path/to/helper'. Git itself accepts '-u<upload-pack>' as equivalent to '--upload-pack=<upload-pack>', executing the helper command. GitPython's check splits multi_options but canonicalizes '-u<value>' to 'u<value>', which does not match the blocked 'u' option, allowing execution of the helper command despite the safety gate. This is a residual bypass of the explicit security boundary in GitPython's clone method. The vulnerability requires an attacker to control the multi_options argument passed to Repo.clone_from and relies on GitPython's default blocking behavior. The issue is confirmed with a local proof of concept that shows the helper script execution despite allow_unsafe_options=False. No patch or official fix is currently documented for this specific bypass in version 3.1.50.
Potential Impact
An attacker who can influence the multi_options parameter in GitPython's Repo.clone_from can bypass the default protection that blocks unsafe git clone options. This allows execution of arbitrary local commands via Git's --upload-pack/-u option during a clone operation. This bypass circumvents an explicit security boundary designed to prevent command execution without explicit allowance, potentially leading to local command execution in the context of the application using GitPython. The clone operation itself may fail if the helper exits nonzero, but the command execution side effect occurs, which could be leveraged for malicious purposes.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The suggested remediation is for GitPython to properly parse and canonicalize joined short options that take values (e.g., '-uVALUE' and '-cKEY=VALUE') to their base short option names before checking against the unsafe option set. Until a fix is released, users should avoid passing untrusted input to the multi_options parameter in Repo.clone_from or explicitly set allow_unsafe_options=True only when safe. Monitoring GitPython repository advisories and updates for a fix addressing this joined short option bypass is recommended.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-v396-v7q4-x2qj
- Osv Schema Version
- 1.4.0
- Aliases
- []
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- HIGH
- Cvss Version
- 4.0
Threat ID: 6a600ac39c2644c7f8fe33ad
Added to database: 07/22/2026, 00:11:47 UTC
Last enriched: 07/22/2026, 00:55:48 UTC
Last updated: 07/31/2026, 12:28:12 UTC
Views: 37
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.