Security mailing lists by PureSourceCode

CVE-2026-40068

HIGH 7.7CVSS 4.0

Claude Code: Trust Dialog Bypass via Git Worktree Spoofing Allows Arbitrary Code Execution

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.

Published
5 May 2026
Last modified
24 Jul 2026
Assigned by
security-advisories@github.com
NVD status
Analyzed
Weakness
CWE-20CWE-77
Also known as
GHSA-q5hj-mxqh-vv77
Sources
NVDJSONOSV GHSA-q5hj-mxqh-vv77JSON

Scores

SourceScored byVersionScoreVector / decision
NVD security-advisories@github.com (Secondary) CVSS 4.0 HIGH 7.7 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
OSV GitHub CVSS 4.0 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
NVD nvd@nist.gov (Primary) CVSS 3.1 HIGH 8.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD anthropic claude_code
cpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:*
>= 2.1.63, < 2.1.84 2.1.84
OSV npm @anthropic-ai/claude-code >= 2.1.63, < 2.1.84 2.1.84

References

History

  • 25 Nov 2026 21:02 UTC · NVD: first stored (published 5 May 2026)
  • 25 Nov 2026 20:11 UTC · OSV: first stored (published 24 Apr 2026)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.