GitPython: Unguarded git option forwarding
Affects GitPythonSource GCVE Database
CVSS 8.1 High : upgrade to 3.1.57 soon.
Data as of 3 Aug 2026, 21:24 UTC
- Patch
- Available – fixed in 3.1.57
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:HWhat to do
Upgrade GitPython to 3.1.57.
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 patch is available for GitPython that addresses these vulnerabilities by adding proper validation and guarding of unsafe git options in the affected methods. Users should upgrade to version 3.1.57 or later. Until patched, avoid passing untrusted input through the affected methods' **kwargs parameters or use alternative safe APIs. Review and restrict usage of IndexFile.checkout() and TagReference.create() to trusted contexts only.
Description
GitPython versions prior to 3.1.57 contain unguarded forwarding of git command options in the methods IndexFile.checkout() and TagReference.create(). This allows an attacker with limited privileges to cause arbitrary file overwrite on the filesystem via the --prefix option in git checkout-index, and arbitrary file read via the -F/--file option in git tag. Both vulnerabilities arise because these methods forward **kwargs directly to git commands without validating or restricting unsafe options. The arbitrary file overwrite can lead to code execution if attacker-controlled repository content is written to sensitive locations. The arbitrary file read exposes file contents to the attacker at the process privilege level. A patch is available to address these issues.
References
- github.com/gitpython-developers/GitPython/security/advisories/GHSA-3f7w-8rr8-f37f (opens in a new tab)
- github.com/gitpython-developers/GitPython/pull/2193 (opens in a new tab)
- github.com/gitpython-developers/GitPython/commit/3af0c2516c5e18c829da30338614688f6b69b49c (opens in a new tab)
- github.com/gitpython-developers/GitPython (opens in a new tab)
- github.com/gitpython-developers/GitPython/releases/tag/3.1.57 (opens in a new tab)