GitPython Remote.pull() refspec bypasses the --upload-pack unsafe-option guard, enabling arbitrary command execution
Affects GitPythonSource GCVE Database
CVSS 8.1 High : upgrade to 3.2.0 soon.
Data as of 27 Oct 2026, 17:27 UTC
- Patch
- Available – fixed in 3.2.0
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HWhat to do
Upgrade GitPython to 3.2.0.
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
A fix is available in GitPython version 3.2.0. Users should upgrade to this version or later to remediate the vulnerability. Until upgraded, avoid passing untrusted input as the refspec argument to Remote.pull().
Description
GitPython's Remote.pull() method improperly handles the positional refspec argument, allowing an attacker to inject a --upload-pack option that bypasses the unsafe-option guard. This leads to arbitrary command execution with the privileges of the calling process when using local-path or SSH transports. The vulnerability is fixed in version 3.2.0.
References
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-f9j4-qggq-h239 (opens in a new tab)
- github.com/gitpython-developers/GitPython/pull/2247 (opens in a new tab)
- github.com/gitpython-developers/GitPython/commit/790bb3164948625ffb043d2a162425d55923fe9a (opens in a new tab)
- github.com/gitpython-developers/GitPython (opens in a new tab)
- github.com/gitpython-developers/GitPython/releases/tag/3.2.0 (opens in a new tab)