Impact
GitPython before version 3.2.0 contains an argument injection flaw in the Head.checkout() function. An attacker can craft a branch name that includes git options, causing the library to interpret the name as a command-line parameter. When this happens, the GitCommandError exposed by GitPython may leak the contents of an arbitrary file. The vulnerability is an instance of CWE-88, which relates to insecure handling of command-line arguments and can lead to unintended file disclosure.
Affected Systems
The affected product is GitPython, maintained by the GitPython developers. Versions earlier than 3.2.0 are vulnerable; any deployment that uses those releases needs to be reviewed. The issue applies to any environment that clones repositories and automatically checks out the active branch using the library's checkout feature.
Risk and Exploitability
The CVSS score of 8.7 indicates high severity. Because the EPSS score is not available, the likelihood of exploitation cannot be quantified, but remote attackers can host a malicious repository to trigger the flaw. The vulnerability is not listed in the CISA KEV catalog, so it has not yet been confirmed as actively exploited. The typical attack path involves the adversary supplying a malicious default branch name such as --pathspec-from-file=<path>, which the library then executes as a git option and returns via an error message.
OpenCVE Enrichment
Debian DLA