What’s Vulnerable › Vulnerabilities
CVE-2026-87817: GitPython before 3.1.60 Remote Code Execution via Git Directory Impersonation
- Severity: high (CVSS 8.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.4% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2026-09-09 · updated 2026-09-16
- Weakness: CWE-94
Description
GitPython before 3.1.60 fails to properly validate the git directory location, allowing attackers to impersonate the git directory using tracked files like gitdir, commondir, and HEAD. Attackers can execute arbitrary code by placing a malicious pre-commit hook in the tracked hooks directory that executes when a victim calls index.commit() on a cloned or opened repository.
Affected products
- gitpython-developers GitPython: before 3.1.60 — fixed in 3.1.60
How to fix
Upgrade to a fixed version: gitpython-developers GitPython 3.1.60. Check the vendor advisory for mitigations.
References
- https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-239g-whfq-7xj9
- https://www.vulncheck.com/advisories/gitpython-before-3.1.60-remote-code-execution-via-git-directory-impersonation
Get alerted when CVE-2026-87817 or the next vulnerability affects your stack