CVE-2026-87817 PUBLISHED

GitPython before 3.1.60 Remote Code Execution via Git Directory Impersonation

Assigner: VulnCheck
Reserved: 09.09.2026 Published: 09.09.2026 Updated: 09.09.2026

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.

Metrics

CVSS Vector: 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
CVSS Score: 8.7

Product Status

Vendor gitpython-developers
Product GitPython
Versions Default: unaffected
  • affected from 0 to 3.1.60 (excl.)
  • Version 3.1.60 is unaffected

Credits

  • dharanivarma reporter

References

Problem Types

  • Improper Control of Generation of Code ('Code Injection') CWE