PT-2026-67305 · Pypi+1 · Gitpython+1
CVSS v2.0
9.0
High
| Vector | AV:N/AC:L/Au:S/C:C/I:C/A:C |
Name of the Vulnerable Software and Affected Versions
GitPython versions prior to 3.1.51
Description
An incomplete command injection blocklist allows attackers to bypass the unsafe options guard. The issue stems from the
check unsafe options() function and canonicalize option name() function, which perform exact-match checks and only normalize underscores to hyphens. This fails to account for the long-option prefix abbreviation feature of git, where git accepts any unambiguous prefix of a long option.Attackers can use abbreviated keys such as
upload p (which git resolves to --upload-pack), receive p (resolved to --receive-pack), or exe (resolved to --exec) to bypass the guard and execute arbitrary commands. This occurs even when allow unsafe options is set to False.Recommendations
Update GitPython to version 3.1.51 or later.
As a temporary mitigation, restrict the use of attacker-controlled keys in the
clone, fetch, pull, and push methods to prevent them from reaching the vulnerable check unsafe options() function.Exploit
Fix
OS Command Injection
Incomplete List of Disallowed Inputs
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Gitpython
Red Os