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…
EPSS 0.3%top 80%

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 that points to a path the victim has previously trusted, causing Claude Code to bypass its trust confirmation dialog and execute hooks defined in . claude/settings.json without user consent. 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 on the victim's system.

CVSS v4.0

Score 7.7high

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/13/2026, 03:47:58 UTC

Technical Analysis

In versions 2.1.63 through 2.1.83 of Claude Code, the folder trust determination logic improperly trusts the contents of the git worktree commondir file without validation. This allows an attacker who can supply a malicious repository with a crafted commondir file to cause Claude Code to bypass the trust confirmation dialog and immediately execute hooks defined in .claude/settings.json. Successful exploitation requires the victim to clone the malicious repository and run Claude Code within it, and the attacker must know or guess a path previously trusted by the victim. The vulnerability is addressed in version 2.1.84.

Potential Impact

An attacker can bypass the trust confirmation dialog in Claude Code and cause automatic execution of potentially malicious hooks, leading to unauthorized code execution within the context of the victim's environment. This could result in compromise of the victim's system or data if the attacker successfully exploits the vulnerability. No known exploits in the wild have been reported at this time.

Mitigation Recommendations

This vulnerability has been fixed in 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 within repositories from untrusted sources, especially if the attacker might know or guess trusted paths on the system. Patch status is confirmed fixed 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/13/2026, 3:47:58 AM

Last updated: 6/20/2026, 5:22:43 AM

Views: 209

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