Impact
GitPython before 3.1.60 does not validate the location of the git directory, which lets an attacker impersonate the directory using tracked files such as gitdir, commondir, and HEAD. By placing a malicious pre‑commit hook in the tracked hooks directory, an attacker can cause arbitrary code execution when a victim runs index.commit() on a repository that the attacker controls. This flaw is an instance of the CWE‑94 code‑injection weakness.
Affected Systems
Affected vendors and products include GitPython developers’ GitPython library. All versions older than 3.1.60 are vulnerable. The vulnerability is identified against the product via the CPE cpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:*:*.
Risk and Exploitability
The flaw carries a high CVSS score of 8.7, indicating significant risk for confidentiality, integrity, and availability. Because the EPSS score is not available, the exact likelihood of exploitation is uncertain, but the vulnerability is listed in no KEV catalog. Exploitation requires that the attacker can supply or influence the repository content that the application will commit; once the victim executes index.commit(), the malicious pre‑commit hook will run with the same privileges as the application. Therefore, the risk is high for systems that automatically commit untrusted code.
OpenCVE Enrichment