CVE-2026-87817
HIGH 8.7CVSS 4.0GitPython: Repository content can impersonate the git directory, leading to arbitrary code execution
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.
- Published
- 9 Sep 2026
- Last modified
- 30 Sep 2026
- Assigned by
- disclosure@vulncheck.com
- NVD status
- Analyzed
- Weakness
- CWE-427CWE-94
- Also known as
- GHSA-239g-whfq-7xj9PYSEC-2026-3982
- Sources
- NVDJSONOSV GHSA-239g-whfq-7xj9JSONOSV PYSEC-2026-3982JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | disclosure@vulncheck.com (Secondary) | CVSS 4.0 | HIGH 8.7 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | PyPA | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X | |
| NVD | disclosure@vulncheck.com (Secondary) | CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | gitpython_project | gitpythoncpe:2.3:a:gitpython_project:gitpython:*:*:*:*:*:python:*:* |
< 3.1.60 | 3.1.60 |
| OSV | PyPI | gitpython | < 3.1.60 | 3.1.60 |
References
- https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-239g-whfq-7xj9 · Exploit, Mitigation, Vendor Advisory, WEB, EVIDENCE
- https://www.vulncheck.com/advisories/gitpython-before-3.1.60-remote-code-execution-via-git-directory-impersonation · Third Party Advisory, WEB, ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2026-87817 · ADVISORY
- https://github.com/gitpython-developers/GitPython/pull/2218 · WEB
- https://github.com/gitpython-developers/GitPython/commit/c7cf4d13b1ed0a2e70f2a1f3c6b4fc6c2652cf0b · WEB
- https://github.com/gitpython-developers/GitPython · PACKAGE
- https://github.com/gitpython-developers/GitPython/releases/tag/3.1.60 · WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2026-3982.yaml · WEB
History
- 25 Nov 2026 21:05 UTC · NVD: first stored (published 9 Sep 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 9 Sep 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 30 Sep 2026)