{"id":"CVE-2026-87817","title":"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","summary":"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 ma…","severity":"high","cvss":8.8,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","cwe":["CWE-94","CWE-22","CWE-427"],"vendor":"gitpython_project","product":"gitpython","affected":["gitpython < 3.1.60"],"patched":["gitpython 3.1.60"],"published":"2026-09-09","updated":"2026-09-16","sourceUpdated":"2026-09-16T15:24:41.533","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-87817","references":[{"url":"https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-239g-whfq-7xj9","label":"disclosure@vulncheck.com"},{"url":"https://www.vulncheck.com/advisories/gitpython-before-3.1.60-remote-code-execution-via-git-directory-impersonation","label":"disclosure@vulncheck.com"},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-87817.json"},{"url":"https://access.redhat.com/security/cve/CVE-2026-87817"},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2530744"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-87817"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-87817"},{"url":"https://access.redhat.com/errata/RHSA-2026:68764"},{"url":"https://access.redhat.com/errata/RHSA-2026:68780"},{"url":"https://access.redhat.com/errata/RHSA-2026:71114"},{"url":"https://access.redhat.com/errata/RHSA-2026:71113"},{"url":"https://access.redhat.com/errata/RHSA-2026:71210"},{"url":"https://access.redhat.com/errata/RHSA-2026:71179"},{"url":"https://access.redhat.com/errata/RHSA-2026:71177"},{"url":"https://github.com/gitpython-developers/GitPython/pull/2218"},{"url":"https://github.com/gitpython-developers/GitPython/commit/c7cf4d13b1ed0a2e70f2a1f3c6b4fc6c2652cf0b"},{"url":"https://github.com/gitpython-developers/GitPython/releases/tag/3.1.60"},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/gitpython/PYSEC-2026-3982.yaml"},{"url":"https://github.com/advisories/GHSA-239g-whfq-7xj9"},{"url":"https://github.com/gitpython-developers/GitPython"},{"url":"https://access.redhat.com/errata/RHSA-2026:74506"},{"url":"https://access.redhat.com/errata/RHSA-2026:74504"},{"url":"https://access.redhat.com/errata/RHSA-2026:74503"},{"url":"https://access.redhat.com/errata/RHSA-2026:74644"},{"url":"https://access.redhat.com/errata/RHSA-2026:74649"},{"url":"https://access.redhat.com/errata/RHSA-2026:74505"},{"url":"https://access.redhat.com/errata/RHSA-2026:84734"}],"tags":["nvd","cve.org","csaf","vex","red-hat","osv","pip","ghsa"],"epss":0.00419,"epssPercentile":0.36036,"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2026-09-10T14:27:39.154180Z"},"ingestedAt":"2026-09-09T12:08:31.842Z","aliases":["PYSEC-2026-3982","GHSA-239g-whfq-7xj9"],"ecosystem":"pip","slug":"CVE-2026-87817","body":"## Overview\n\nGitPython 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.\n\n## Affected\n\n- `gitpython < 3.1.60`\n\n## Remediation\n\nUpgrade past the affected range:\n\n- `gitpython 3.1.60`\n\n## Vendor advisories\n\n- **Red Hat VEX** · Important · affected: Exploit Intelligence, Red Hat AI Inference Server, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux AI (RHEL AI) 3, Red Hat OpenShift AI (RHOAI), Red Hat OpenStack Platform 16.2 · no fix planned: Exploit Intelligence, Red Hat AI Inference Server, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux AI (RHEL AI) 3, … · updated 2026-10-19 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-87817.json)\n- **RHSA-2026:68764** · Red Hat · fixed in: Red Hat Satellite 6.18 · released 2026-09-17 · [advisory](https://access.redhat.com/errata/RHSA-2026:68764)\n- **RHSA-2026:68780** · Red Hat · fixed in: Red Hat Satellite 6.19 · released 2026-09-17 · [advisory](https://access.redhat.com/errata/RHSA-2026:68780)\n- **RHSA-2026:71114** · Red Hat · fixed in: Red Hat Ansible Automation Platform 2.5 for RHEL 8, Red Hat Ansible Automation Platform 2.5 for RHEL 9 · released 2026-09-23 · [advisory](https://access.redhat.com/errata/RHSA-2026:71114)\n- **RHSA-2026:71113** · Red Hat · fixed in: Red Hat Ansible Automation Platform 2.6 for RHEL 9 · released 2026-09-23 · [advisory](https://access.redhat.com/errata/RHSA-2026:71113)\n- **RHSA-2026:71210** · Red Hat · fixed in: Red Hat Ansible Automation Platform 2.5 · released 2026-09-23 · [advisory](https://access.redhat.com/errata/RHSA-2026:71210)\n- **RHSA-2026:71179** · Red Hat · fixed in: Red Hat Ansible Automation Platform 2.6 · released 2026-09-23 · [advisory](https://access.redhat.com/errata/RHSA-2026:71179)\n- **RHSA-2026:71177** · Red Hat · fixed in: Red Hat Ansible Automation Platform 2.7 · released 2026-09-23 · [advisory](https://access.redhat.com/errata/RHSA-2026:71177)\n- **RHSA-2026:74506** · Red Hat · fixed in: Red Hat Satellite 6.16 for RHEL 8, Red Hat Satellite 6.16 for RHEL 9 · released 2026-10-01 · [advisory](https://access.redhat.com/errata/RHSA-2026:74506)\n- **RHSA-2026:74504** · Red Hat · fixed in: Red Hat Satellite 6.18 for RHEL 9 · released 2026-10-01 · [advisory](https://access.redhat.com/errata/RHSA-2026:74504)\n- **RHSA-2026:74503** · Red Hat · fixed in: Red Hat Satellite 6.19 for RHEL 9 · released 2026-10-01 · [advisory](https://access.redhat.com/errata/RHSA-2026:74503)\n- **RHSA-2026:74644** · Red Hat · fixed in: Red Hat Satellite 6.18 · released 2026-10-01 · [advisory](https://access.redhat.com/errata/RHSA-2026:74644)\n- **RHSA-2026:74505** · Red Hat · fixed in: Red Hat Satellite 6.17 for RHEL 9 · released 2026-10-01 · [advisory](https://access.redhat.com/errata/RHSA-2026:74505)\n- **RHSA-2026:84734** · Red Hat · fixed in: Red Hat OpenShift AI 3.4 · released 2026-10-19 · [advisory](https://access.redhat.com/errata/RHSA-2026:84734)\n\n## Package advisory (CVE-2026-87817)\n\nAffected packages:\n\n- `gitpython < 3.1.60`\n\nPatched in:\n\n- `gitpython 3.1.60`\n\nSource: https://osv.dev/vulnerability/PYSEC-2026-3982","depth":"twilight","depthScore":48,"depthScoreParts":{"impact":48.4,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}