REDHAT-BUG-2519610: High severity GitPython GitPython vulnerability
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
Which deployments are exposed to this issue?
Deployments using GitPython versions before 3.1.58 are affected when untrusted input can reach crafted keyword arguments passed to guarded methods such as clone_from.
Does the default safety setting prevent exploitation?
No. The bypass works with the default allow_unsafe_options=False setting by combining a single-character keyword argument with split_single_char_options=False.
What does an attacker need to exploit this vulnerability?
An attacker needs the ability to supply a crafted kwargs dictionary to a guarded GitPython method, such as clone_from. The crafted arguments can cause a joined token to be parsed as --upload-pack and result in arbitrary OS command execution.