{"cve":"CVE-2026-40068","nvd":{"published":"2026-05-05T21:16:23.093","modified":"2026-07-24T21:10:00.143","status":"Analyzed","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.","cvss_v4":{"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","score":7.7},"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8},"cwes":["CWE-20","CWE-77"],"references":["https://github.com/anthropics/claude-code/security/advisories/GHSA-q5hj-mxqh-vv77"],"products":["anthropic:claude_code"],"source":"nvd","synced_at":"2026-10-19T22:33:55.586217763+00:00"},"epss":{"cve":"CVE-2026-40068","score":0.00314,"percentile":0.24356,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-q5hj-mxqh-vv77","url":"https://osv.dev/vulnerability/GHSA-q5hj-mxqh-vv77","summary":"Claude Code: Trust Dialog Bypass via Git Worktree Spoofing Allows Arbitrary Code Execution","modified":"2026-05-08T15:50:36.976042Z","packages":[{"ecosystem":"npm","name":"@anthropic-ai/claude-code","purl":"pkg:npm/%40anthropic-ai/claude-code","ranges":[">=2.1.63 <2.1.84"],"fixed":["2.1.84"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}