{"id":"CVE-2026-40068","published":"2026-05-05T20:52:26Z","modified":"2026-05-06T15:24:52Z","title":"Claude Code arbitrary code execution via git worktree commondir trust dialog bypass","vendor":"anthropics","product":"claude-code","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.7,"severity":"HIGH","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00562,"percentile":0.40466,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"},{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command"}],"references":[{"url":"https://github.com/anthropics/claude-code/security/advisories/GHSA-q5hj-mxqh-vv77","tags":["x_refsource_CONFIRM"]}],"priority":{"score":13.5,"factors":[{"name":"EPSS percentile","points":8.09},{"name":"CVSS severity","points":5.39}]},"vendorSlug":"anthropics","affectedVersions":[{"vendor":"anthropics","product":"claude-code","versions":[">= 2.1.63, < 2.1.84"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-05-06T14:50:01.382886Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"@anthropic-ai/claude-code","vulnerableRanges":[">=2.1.63, <2.1.84"],"patched":["2.1.84"],"from":["GHSA-q5hj-mxqh-vv77"],"provenance":"source"}],"summary":{"text":"In Claude Code, the folder trust determination logic trusted the contents of the git worktree commondir file without validating them, affecting versions 2.1.63 through 2.1.83. An attacker who can get a victim to clone a malicious repository and run Claude Code inside it, and who knows or can guess a path the victim has already trusted, can cause the trust confirmation dialog to be bypassed so that hooks in .claude/settings.json execute immediately, which requires user interaction.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:59:56Z"},"euvd":{"id":"EUVD-2026-27502","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2026-33068","published":"2026-03-20","fixed":"2.1.53","kev":false},{"cve":"CVE-2026-39861","published":"2026-04-21","fixed":"2.1.64","kev":false},{"cve":"CVE-2026-35603","published":"2026-04-17","fixed":"2.1.75","kev":false,"link":{"from":"CVE-2026-35603","to":"CVE-2026-40068","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:@anthropic-ai/claude-code","fromFixed":"2.1.75","toFixed":"2.1.84","daysApart":18}]}},{"cve":"CVE-2026-40068","published":"2026-05-05","fixed":"2.1.84","kev":false},{"cve":"CVE-2026-46406","published":"2026-06-29","fixed":"2.1.128","kev":false,"link":{"from":"CVE-2026-40068","to":"CVE-2026-46406","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:@anthropic-ai/claude-code","fromFixed":"2.1.84","toFixed":"2.1.128","daysApart":55}]}},{"cve":"CVE-2026-54316","published":"2026-06-23","fixed":"2.1.163","kev":false},{"cve":"CVE-2026-55607","published":"2026-06-29","fixed":"2.1.163","kev":false}],"package":"npm:@anthropic-ai/claude-code"}}