CVE-2026-76220: GitPython before 3.1.58 Command Execution via split_single_char_options
GitPython before 3.1.58 contains a command execution vulnerability in the checkunsafeoptions guard that can be bypassed by combining a single-character kwarg with splitsinglecharoptions=False. Attackers can supply a crafted kwargs dictionary to guarded methods like clonefrom to emit a joined token parsed as --upload-pack, enabling arbitrary OS command execution at default allowunsafeoptions=False.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
GitPythonto a version that resolves this vulnerability.Fixed in 3.1.58
Event History
Frequently Asked Questions
Who can exploit this issue?
An attacker needs the ability to supply a crafted kwargs dictionary to a GitPython guarded method, such as clone_from. No user interaction is required, but the attacker must have privileges to influence those method arguments.
Are default GitPython settings affected?
Yes. The bypass works even when allow_unsafe_options is left at its default value of False, by combining a single-character keyword argument with split_single_char_options=False.
What version resolves the issue?
Upgrade GitPython to version 3.1.58 or later. Versions before 3.1.58 are affected according to the advisory information provided.
What can be done if an immediate upgrade is not possible?
Do not pass attacker-controlled kwargs to guarded GitPython methods such as clone_from. In particular, prevent callers from controlling split_single_char_options or from supplying crafted single-character option keys that can be joined into unsafe Git options.