GitPython unsafe clone option gate bypass through joined short options
Affects GitPythonSource GCVE Database
CVSS 8.7 High : upgrade to 3.1.51 soon.
Data as of 22 Jul 2026, 00:55 UTC
- Patch
- Available – fixed in 3.1.51
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NWhat to do
Upgrade GitPython to 3.1.51.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIGitPython | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
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. If you cannot patch yet, 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.
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.
References
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-v396-v7q4-x2qj (opens in a new tab)
- github.com/gitpython-developers/GitPython/pull/2162 (opens in a new tab)
- github.com/gitpython-developers/GitPython (opens in a new tab)
- github.com/gitpython-developers/GitPython/releases/tag/3.1.51 (opens in a new tab)