CVE-2026-87817: Improper Control of Generation of Code ('Code Injection') in gitpython-developers GitPython
GitPython versions prior to 3.1.60 contain a code injection vulnerability due to improper validation of git directory locations. This flaw allows attackers to impersonate the git directory by manipulating tracked files such as gitdir, commondir, and HEAD. Exploitation involves placing a malicious pre-commit hook in the tracked hooks directory, which executes arbitrary code when a victim calls index.commit() on a cloned or opened repository.
AI Analysis
Technical Summary
CVE-2026-87817 is a high-severity code injection vulnerability in GitPython before version 3.1.60. The vulnerability arises from insufficient validation of the git directory location, enabling attackers to impersonate the git directory using tracked files like gitdir, commondir, and HEAD. By placing a malicious pre-commit hook in the tracked hooks directory, an attacker can achieve arbitrary code execution when the victim invokes the index.commit() method on a cloned or opened repository. This vulnerability does not require privileges or user interaction beyond calling index.commit().
Potential Impact
Successful exploitation allows an attacker to execute arbitrary code in the context of the user running GitPython by leveraging a malicious pre-commit hook. This can lead to compromise of the victim system or environment where GitPython is used. The vulnerability has a CVSS 4.0 score of 8.7, indicating high severity with network attack vector, low attack complexity, no privileges required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using untrusted repositories or invoking index.commit() on repositories that may contain malicious hooks. Monitor vendor channels for updates and apply patches promptly once released.
CVE-2026-87817: Improper Control of Generation of Code ('Code Injection') in gitpython-developers GitPython
Description
GitPython versions prior to 3.1.60 contain a code injection vulnerability due to improper validation of git directory locations. This flaw allows attackers to impersonate the git directory by manipulating tracked files such as gitdir, commondir, and HEAD. Exploitation involves placing a malicious pre-commit hook in the tracked hooks directory, which executes arbitrary code when a victim calls index.commit() on a cloned or opened repository.
CVSS v4.0
Score 8.7high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-87817 is a high-severity code injection vulnerability in GitPython before version 3.1.60. The vulnerability arises from insufficient validation of the git directory location, enabling attackers to impersonate the git directory using tracked files like gitdir, commondir, and HEAD. By placing a malicious pre-commit hook in the tracked hooks directory, an attacker can achieve arbitrary code execution when the victim invokes the index.commit() method on a cloned or opened repository. This vulnerability does not require privileges or user interaction beyond calling index.commit().
Potential Impact
Successful exploitation allows an attacker to execute arbitrary code in the context of the user running GitPython by leveraging a malicious pre-commit hook. This can lead to compromise of the victim system or environment where GitPython is used. The vulnerability has a CVSS 4.0 score of 8.7, indicating high severity with network attack vector, low attack complexity, no privileges required, and high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using untrusted repositories or invoking index.commit() on repositories that may contain malicious hooks. Monitor vendor channels for updates and apply patches promptly once released.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-09-09T10:32:34.109Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6aa1450bacd9273b494035f2
Added to database: 09/09/2026, 11:37:47 UTC
Last enriched: 09/09/2026, 11:52:15 UTC
Last updated: 09/09/2026, 11:55:46 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.