Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @anthropic-ai/claude-code
  4. ›
  5. CVE-2026-40068

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

April 24, 2026 (updated May 8, 2026)

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 for reporting this issue.

References

  • github.com/advisories/GHSA-q5hj-mxqh-vv77
  • github.com/anthropics/claude-code
  • github.com/anthropics/claude-code/security/advisories/GHSA-q5hj-mxqh-vv77
  • nvd.nist.gov/vuln/detail/CVE-2026-40068

Code Behaviors & Features

Detect and mitigate CVE-2026-40068 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.1.63 before 2.1.84

Fixed versions

  • 2.1.84

Solution

Upgrade to version 2.1.84 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation
  • CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')

Source file

npm/@anthropic-ai/claude-code/CVE-2026-40068.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:17:54 +0000.