Vulnerability · Published Sep 9, 2026 · Assigned by VulnCheck

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

High 8.8

In plain English

A high-severity code injection in GitPython from gitpython-developers. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 36% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.8High
Exploit odds (30 days)0.4%top 63.6% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12python-git3.1.30-1+deb12u3DEBIAN-CVE-2026-87817
Debian:13python-git3.1.44-1+deb13u1DEBIAN-CVE-2026-87817
Debian:14python-git3.1.61-1DEBIAN-CVE-2026-87817
PyPIgitpython3.1.60GHSA-239g-whfq-7xj9
PyPIgitpython3.1.60PYSEC-2026-3982

Affected products (as reported)

VendorProductVersions
gitpython-developers GitPython 0 – before 3.1.60

Weakness: CWE-94 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

References