Skip to main content
VulnerabilityPublished

GitPython unsafe clone option gate bypass through joined short options

Affects GitPythonSource GCVE Database

0

CVSS 8.7 High : upgrade to 3.1.51 soon.

Data as of 22 Jul 2026, 00:55 UTC

CVSS 4.0 base score
8.7High
How severe the flaw is on the 0–10 CVSS scale.
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:N

What to do

Upgrade GitPython to 3.1.51.

Affected software

ProductAffectedFixed in
PyPIGitPythonAffected
  • >=3.1.50 <3.1.51
  • =3.1.50
Fixed in
  • 3.1.51

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

Community reviews

Loading reviews…