Skip to main content
VulnerabilityPublished Updated

CVE-2026-40068: Claude Code · Trust Dialog Bypass via Git Worktree Spoofing Allows Arbitrary Code Execution

Affects @anthropic-ai/claude-codeSource GCVE Database

0
Authoritative record:CVE-2026-40068· High 7.7

Not known to be exploited · CVSS 7.7 High : upgrade to 2.1.84 soon.

Data as of 27 Oct 2026, 00:07 UTC

CVSS 4.0 base score
7.7High
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 2.1.84
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

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 5 May 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.

What to do

Upgrade @anthropic-ai/claude-code to 2.1.84.

Affected software

ProductAffectedFixed in
npm@anthropic-ai/claude-codeAffected
  • >=2.1.63 <2.1.84
Fixed in
  • 2.1.84

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

Description

Claude Code used the git worktree `commondir` file when determining folder trust but did not validate its contents. By crafting a repository with a `commondir` file pointing to a path the victim had previously trusted, an attacker could bypass the trust dialog and immediately execute malicious hooks defined in `.claude/settings.json`. Exploiting this required the victim to clone a malicious repository and run Claude Code within it, and for the attacker to know or guess a path the victim had already trusted. Users on standard Claude Code auto-update have received this fix already. Users performing manual updates are advised to update to the latest version. Claude Code thanks [hackerone.com/masato_anzai](https://hackerone.com/masato_anzai) for reporting this issue.

References

Community reviews

Loading reviews…