CVE-2026-87817
8.8GitPython · GitPython
GitPython before 3.1.60 is vulnerable to arbitrary code execution due to improper validation of the git directory location, allowing attackers to impersonate directories via tracked files.
Executive summary
A critical vulnerability in GitPython allows unauthenticated attackers to achieve remote code execution by tricking a user into interacting with a malicious repository.
Vulnerability
This is a code injection flaw (CWE-94) where the software fails to validate the git directory path. An attacker can leverage this to place malicious pre-commit hooks in tracked directories, which execute when the victim performs an index.commit() operation.
Business impact
The vulnerability carries a high CVSS score of 8.8, reflecting the severe impact of potential remote code execution. Successful exploitation allows an attacker to gain full control over the user's environment, potentially leading to unauthorized data access, lateral movement within the network, and complete system compromise.
Remediation
Immediate Action: Update the GitPython library to version 3.1.60 or later immediately to incorporate the necessary validation patches.
Proactive Monitoring: Review CI/CD pipelines and developer workstations for unexpected execution of git hooks or abnormal file system activity within git repositories.
Compensating Controls: Ensure that git repositories are only cloned from trusted sources and consider implementing environment isolation for automated build processes that utilize GitPython.
Exploitation status
Public Exploit Available: Unknown
Analyst recommendation
Given the high severity of this remote code execution flaw, organizations using GitPython in automated environments or developer tools must prioritize this update. Ensure all instances of the library are patched to 3.1.60 to eliminate the directory impersonation risk and secure the development pipeline against potential malicious repositories.
More GitPython CVEs
History
- Disclosed CVE record published
- Collected by CVE Brief via github
- Analyst report written
- Published in the daily brief high section
Sources
Originally found and disclosed by dharanivarma, per the CVE Program record.
- GitHub Security Advisory (GHSA-239g-whfq-7xj9) Vendor advisory
- VulnCheck Advisory: GitPython before 3.1.60 Remote Code Execution via Git Directory Impersonation Third-party advisory