# CVE-2026-40068: Claude Code arbitrary code execution via git worktree commondir trust dialog bypass

- Severity: High 7.7 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.31%, higher than 26% of CVEs (2026-12-01)
- Published: 2026-04-24T16:34:03.000Z
- Modified: 2026-07-24T21:10:00.143Z
- Also known as: GHSA-q5hj-mxqh-vv77
- Weaknesses: CWE-20, CWE-77
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- anthropics claude-code: >= 2.1.63, < 2.1.84
- @anthropic-ai/claude-code (npm): from 2.1.63 before 2.1.84
- anthropic claude_code: from 2.1.63 before 2.1.84

## Every score

- GitHub_M: CVSS:4.0 7.7 High `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`
- GitHub: CVSS:4.0 High `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: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://github.com/anthropics/claude-code/security/advisories/GHSA-q5hj-mxqh-vv77> (vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40068> (advisory)
- <https://github.com/anthropics/claude-code> (package)

## Sources

- CVE List: [CVE-2026-40068](https://www.cve.org/CVERecord?id=CVE-2026-40068), CVE Terms of Use, modified 2026-05-06
- GitHub Advisory Database: [GHSA-q5hj-mxqh-vv77](https://github.com/advisories/GHSA-q5hj-mxqh-vv77), CC-BY-4.0, modified 2026-05-08
- NVD: [CVE-2026-40068](https://nvd.nist.gov/vuln/detail/CVE-2026-40068), Public domain, modified 2026-07-24

---

Page: https://cve.day/CVE-2026-40068 · Whole record: https://cve.day/CVE-2026-40068.json · Rebuilt by cve.day 2026-11-25T22:59:20.648Z
