Skip to main content
VulnerabilityPublished

GitPython: Unguarded git option forwarding

Affects GitPythonSource GCVE Database

0

CVSS 8.1 High : upgrade to 3.1.57 soon.

Data as of 3 Aug 2026, 21:24 UTC

CVSS 3.1 base score
8.1High
How severe the flaw is on the 0–10 CVSS scale.
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:H

What to do

Upgrade GitPython to 3.1.57.

Affected software

ProductAffectedFixed in
PyPIGitPythonAffected
  • <3.1.57
Fixed in
  • 3.1.57

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

Community reviews

Loading reviews…