{"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"],"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"}],"tags":["nvd","cve.org","csaf","vex","red-hat","osv","pip"],"epss":0.00327,"epssPercentile":0.25944,"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, Migration Toolkit for Applications 8, Red Hat AI Inference Server, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux AI (RHEL AI) 3, Red Hat OpenShift AI (RHOAI), … · no fix planned: Exploit Intelligence, Red Hat Ansible Automation Platform 2, Migration Toolkit for Applications 8, Red Hat AI Inference Server, … · updated 2026-09-21 · [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\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":[]}