PatchSiren

PatchSiren cyber security CVE debrief

CVE-2026-87817 gitpython-developers CVE debrief

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.

Vendor
gitpython-developers
Product
GitPython
CVSS
HIGH 8.7
CISA KEV
Not listed in stored evidence
Original CVE published
2026-09-09
Original CVE updated
2026-09-16
Advisory published
2026-09-09
Advisory updated
2026-09-16

Who should care

Defenders responsible for managing GitPython repositories, developers using GitPython in their applications, and security teams monitoring for potential code execution vulnerabilities should be aware of this vulnerability and take necessary actions to update and secure their repositories.

Why it matters

CVE-2026-87817 is a high-severity vulnerability in GitPython that allows attackers to impersonate the git directory and potentially execute arbitrary code via malicious pre-commit hooks. Defenders should prioritize updating GitPython to version 3.1.60 or later and implement additional security measures to monitor and restrict repository interactions.

  • Potential code execution via malicious pre-commit hooks
  • Impersonation of git directory using tracked files
  • Elevation of privileges in GitPython repositories
  • Compromise of repository integrity and confidentiality

Technical 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 malicious pre-commit hook in the tracked hooks directory that executes when a victim calls index.commit() on a cloned or opened repository. Defenders should prioritize updating GitPython to version 3.1.60 or later to prevent potential code execution via malicious pre-commit hooks in GitPython repositories. This vulnerability allows for impersonation of the git directory and potential elevation of privileges in GitPython repositories, impacting repository integrity and integrity.

Defensive priority

Defenders should prioritize updating GitPython to version 3.1.60 or later to prevent potential code execution via malicious pre-commit hooks in GitPython repositories.

Recommended defensive actions

  • Update GitPython to version 3.1.60 or later
  • Review and validate git directory locations in cloned or opened repositories
  • Implement additional security measures to monitor and restrict repository interactions
  • Confirm whether affected GitPython deployments exist in managed environments and assign an owner for follow-up
  • Review the supplied official advisory or CVE record to validate affected scope, severity, and vendor guidance
  • Plan vendor-supported updates or mitigations through normal change control where exposure is confirmed
  • Check relevant monitoring, detection, and logs for exposed assets that need extra review

Evidence notes

The CVE record and NVD entry provide details on the vulnerability in GitPython before version 3.1.60, which allows attackers to impersonate the git directory and potentially execute arbitrary code via malicious pre-commit hooks.

Sources and references

Verified primary and authoritative sources

  • CVE-2026-87817 CVE Program record

    Publisher, destination, and source semantics verified

    URL: https://www.cve.org/CVERecord?id=CVE-2026-87817

    CVE Program - Official CVE Program record with source-provided CVE metadata.

  • CVE-2026-87817 NVD vulnerability detail

    Publisher, destination, and source semantics verified

    URL: https://nvd.nist.gov/vuln/detail/CVE-2026-87817

    NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.

Supplemental references

  • Source reference

    Unverified legacy reference

    URL: https://github.com/gitpython-developers/GitPython/security/advisories/GHSA-239g-whfq-7xj9

    [email protected] - Exploit, Mitigation, Vendor Advisory

  • Source reference

    Unverified legacy reference

    URL: https://www.vulncheck.com/advisories/gitpython-before-3.1.60-remote-code-execution-via-git-directory-impersonation

    [email protected] - Third Party Advisory

Methodology and review provenance

AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.