Skip to main content
VulnerabilityPublished Updated

CVE-2026-87817: GitPython · Repository content can impersonate the git directory, leading to arbitrary code execution

Affects cruftSource GCVE Database

0
Authoritative record:CVE-2026-87817· High 8.7

Not known to be exploited · CVSS 8.7 High : upgrade to 2.16.0_15 soon.

Data as of 26 Oct 2026, 17:43 UTC

CVSS 4.0 base score
8.7High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.4% chance of exploitation in 30 days – higher than 35% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 2.16.0_15
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

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 9 Sep 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.

What to do

Upgrade cruft to 2.16.0_15.

Affected software

ProductAffectedFixed in
Homebrewcruftpkg:brew/cruftOther threatsAffected
  • >=2.9.0 <2.16.0_15
Fixed in
  • 2.16.0_15

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A fix is available in GitPython version 2.16.0_15. Users should upgrade to this version or later to remediate the vulnerability. The vendor's advisory recommends changes to the directory discovery order to test the real .git directory first, validation of HEAD contents, and safer resolution of hook paths. Until patched, avoid performing commits on repositories cloned from untrusted sources using GitPython.

Description

GitPython version 3.1.59 contains a vulnerability (CVE-2026-87817) where the library incorrectly resolves the git directory path by testing candidate paths in an order that places the real .git directory last. This allows attacker-controlled repository content to impersonate the git directory, leading to arbitrary code execution when a victim performs a commit using GitPython's native index.commit() method. The vulnerability also allows reading files outside the repository and writing config files to attacker-chosen locations. The issue affects GitPython versions >=2.9.0 and <2.16.0_15 and has a CVSS score of 8.8 (high severity). A fix is available in version 2.16.0_15.

References

Community reviews

Loading reviews…