The CVSS 8.8 rating is analytically misleading here—this is fundamentally a supply-chain attack vector with significant preconditions, and the 0.00309 EPSS score reflects a market that correctly senses the gap between theoretical severity and operational exploitability. The vulnerability requires an attacker to control repository contents at checkout time, either by compromising an upstream or by convincing a victim to clone a malicious repository. GitPython misidentifies the git directory by trusting tracked files like gitdir and HEAD, allowing attackers to redirect where GitPython believes its hooks live. This exploit lives in tracked files, not git history—a security review checking commit signatures and history will miss this entirely. The payload arrives through normal git checkout behavior, making it invisible to provenance tools that trust git history. This is a supply-chain attack where the attacker leverages the victim's own trust in cloned repositories. The fix in 3.1.60 matters most for CI/CD pipelines and automated systems that clone third-party repositories—security scanners, license compliance tools, and artifact registries all operate on the false premise that checked-out content is inert. Critically, the validation logic added by the patch becomes the next audit surface: the fix closes one attack path but creates a new 'trusted validation layer' that will be targeted by follow-on exploits. Organizations should instrument their GitPython usage now, not just patch to 3.1.60, because the attack that matters won't be this CVE—it will be the successor that exploits whatever the fix assumes is trustworthy. Monitor for gitdir and HEAD file manipulations in cloned repositories, and audit tools that process repository contents for assumptions about checkout-layer integrity.
CVE-2026-87817
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedGitPython 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysisThe application evaluates attacker-influenced input as code, handing them a way to run logic inside the process. Depending on the runtime this can escalate directly to remote code execution. Remediation means removing dynamic evaluation of untrusted input and replacing it with safe, data-driven alternatives.
General guidance for the code injection class — the official description and references above are authoritative for this specific CVE. Want a bespoke review and a reviewed fix? Ask our team →
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data< 3.1.60CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped3.1.60
GitPython 3.1.60
- Check the current installed version of GitPython using pip show gitpython or pip list | grep GitPython
- Upgrade GitPython to version 3.1.60 or later using: pip install --upgrade gitpython
- Verify the upgrade was successful by checking the installed version again
- If using GitPython in a project, ensure the dependency specification in your requirements.txt, setup.py, or pyproject.toml reflects the minimum version requirement of gitpython>=3.1.60
Generated from the published advisory — verify against the referenced sources before acting.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-87817 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesThe CVSS 8.8 rating is analytically misleading here—this is fundamentally a supply-chain attack vector with significant preconditions, and the 0.00309 EPSS score reflects a market that correctly senses the gap between theoretical severity and operational exploitability. The vulnerability requires an attacker to control repository contents at checkout time, either by compromising an upstream or by convincing a victim to clone a malicious repository. GitPython misidentifies the git directory by trusting tracked files like gitdir and HEAD, allowing attackers to redirect where GitPython believes its hooks live. This exploit lives in tracked files, not git history—a security review checking commit signatures and history will miss this entirely. The payload arrives through normal git checkout behavior, making it invisible to provenance tools that trust git history. This is a supply-chain attack where the attacker leverages the victim's own trust in cloned repositories. The fix in 3.1.60 matters most for CI/CD pipelines and automated systems that clone third-party repositories—security scanners, license compliance tools, and artifact registries all operate on the false premise that checked-out content is inert. Critically, the validation logic added by the patch becomes the next audit surface: the fix closes one attack path but creates a new 'trusted validation layer' that will be targeted by follow-on exploits. Organizations should instrument their GitPython usage now, not just patch to 3.1.60, because the attack that matters won't be this CVE—it will be the successor that exploits whatever the fix assumes is trustworthy. Monitor for gitdir and HEAD file manipulations in cloned repositories, and audit tools that process repository contents for assumptions about checkout-layer integrity.
Practitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-87817 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data