CVE-2026-40068

Claude Code arbitrary code execution via git worktree commondir trust dialog bypass

HIGH
8.8
CVSS Score
Published: May 5, 2026 at 08:52 PM UTC
Updated: July 24, 2026 at 09:20 PM UTC
2 products affected across 2 vendorsClaude CodeClaude Code

Using claude-code by anthropics?

Get instant alerts when new vulnerabilities affect claude-code - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.8
Exploit prediction
EPSS 0.3%
SSVC
No known exploit

Description

In versions 2.1.63 through 2.1.83 of Claude Code, the folder trust determination logic used the git worktree commondir file without validating its contents. An attacker could craft a malicious repository with a commondir file pointing to a path the victim had previously trusted, causing Claude Code to bypass its trust confirmation dialog and immediately execute hooks defined in `.claude/settings.json`. Exploitation requires the victim to clone the malicious repository and run Claude Code within it, and the attacker must know or guess a path the victim had already trusted. This issue has been fixed in version 2.1.84.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

2.1.63 ≤ v < 2.1.84
Affected range stops below 2.1.84, so it looks safe — our inference, not a vendor statement
v < 2.1.84
Affected range stops below 2.1.84, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-20CWE-77NVD-CWE-noinfo

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card