Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-40068: CWE-20: Improper Input Validation in anthropics claude-code

0
High
VulnerabilityCVE-2026-40068cvecve-2026-40068cwe-20cwe-77
Published: Tue May 05 2026 (05/05/2026, 20:52:26 UTC)
Source: CVE Database V5
Vendor/Project: anthropics
Product: claude-code

Description

CVE-2026-40068 is a high-severity vulnerability in anthropics claude-code versions 2. 1. 63 through 2. 1. 83. The issue arises from improper input validation of the git worktree commondir file used in folder trust determination logic. An attacker can craft a malicious repository with a commondir file referencing a path the victim previously trusted, causing claude-code to bypass its trust confirmation dialog and execute hooks defined in . claude/settings. json without user approval. Exploitation requires the victim to clone the malicious repository and run claude-code within it, and the attacker must know or guess a trusted path.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/05/2026, 21:36:30 UTC

Technical Analysis

In anthropics claude-code versions 2.1.63 to 2.1.83, the folder trust determination logic does not validate the contents of the git worktree commondir file. This allows an attacker to craft a malicious repository with a commondir file pointing to a previously trusted path, bypassing the trust confirmation dialog. As a result, hooks defined in .claude/settings.json execute immediately upon running claude-code in the malicious repository. The vulnerability requires user interaction (cloning and running the repository) and knowledge or guessing of a trusted path. The issue is addressed in version 2.1.84.

Potential Impact

Successful exploitation allows an attacker to bypass the trust confirmation dialog and execute arbitrary hooks defined in the .claude/settings.json file. This could lead to execution of malicious code within the context of claude-code, potentially compromising the user's environment. The attack requires user action and some knowledge about the victim's trusted paths. There are no known exploits in the wild at this time.

Mitigation Recommendations

This vulnerability has been fixed in anthropics claude-code version 2.1.84. Users should upgrade to version 2.1.84 or later to remediate this issue. Until upgrading, users should avoid cloning and running claude-code in untrusted repositories, especially those that might contain manipulated commondir files. Patch status is not explicitly stated in the vendor advisory, but the fix is included in version 2.1.84.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-04-09T00:39:12.204Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 69fa5fd1cbff5d8610282e49

Added to database: 5/5/2026, 9:23:29 PM

Last enriched: 5/5/2026, 9:36:30 PM

Last updated: 5/5/2026, 10:29:06 PM

Views: 2

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses