# CVE-2026-87817: GitPython before 3.1.60 Remote Code Execution via Git Directory Impersonation

- Priority: **Prioritise**
- Reason: Public exploit (GitHub, Date unknown)
- Next step: Check applicability: affected before 3.1.60 (CNA); fix release not confirmed
- Status: published
- Published: 2026-09-09 · Modified: 2026-10-08
- Aliases: GHSA-239g-whfq-7xj9, PYSEC-2026-3982, UBUNTU-CVE-2026-87817, DEBIAN-CVE-2026-87817, CGA-4gh9-vrm7-r5rh, CGA-7467-6594-qjg2, CGA-8vr3-vwh8-69rq, CGA-cpp3-gw43-rv8f, CGA-jv6j-w246-26pj, CGA-p6x5-8363-6j7h, CGA-xc3j-mf7q-pg24
- Record: https://cvemate.com/vulnerability/CVE-2026-87817 · JSON: https://cvemate.com/vulnerability/CVE-2026-87817/json

## Description

```text
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.
```

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- EPSS: 0.419%, percentile 38.179%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected

- chainguard awx (Chainguard): \< 24.6.1-r64
- chainguard nemo-rl-cuda-13.0 (Chainguard): \< 0.7.0-r2
- chainguard nemo-rl-cuda-13.0-automodel (Chainguard): \< 0.7.0-r2
- chainguard nemo-rl-cuda-13.0-mcore (Chainguard): \< 0.7.0-r2
- chainguard nemo-rl-cuda-13.0-sglang (Chainguard): \< 0.7.0-r2
- chainguard nemo-rl-cuda-13.0-vllm (Chainguard): \< 0.7.0-r2
- debian python-git (Debian): All versions (No fix recorded) \| \< 3.1.30-1+deb12u3 \| \< 3.1.44-1+deb13u1 \| \< 3.1.61-1
- ubuntu python-git (Ubuntu): All versions (No fix recorded)
- gitpython\_project gitpython: \< 3.1.60
- gitpython-developers gitpython: \< 3.1.60
- PyPI gitpython (PyPI): \< 3.1.60

## 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>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-87817>
- <https://github.com/gitpython-developers/GitPython/pull/2218>
- <https://github.com/gitpython-developers/GitPython/commit/c7cf4d13b1ed0a2e70f2a1f3c6b4fc6c2652cf0b>
- <https://github.com/gitpython-developers/GitPython>
- <https://github.com/gitpython-developers/GitPython/releases/tag/3.1.60>
- <https://github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2026-3982.yaml>
- <https://ubuntu.com/security/CVE-2026-87817>
- <https://www.cve.org/CVERecord?id=CVE-2026-87817>
- <https://security-tracker.debian.org/tracker/CVE-2026-87817>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/87xxx/CVE-2026-87817.json>

---

Data as of 2026-12-05T06:22:57.660Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
