Browse / Tool and Agent Misuse / CVE-2026-55607
Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution
- Class
- Tool and Agent Misuse (filed by a model that read the advisory)
- Technique
- Sandbox escape
- Also involves
- Indirect Prompt Injection
- Affected
- @anthropic-ai/claude-code (npm)
- Gets past
- Sandbox or allowlist
- CVSS
- 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
- EPSS
- 0.7% chance of exploitation in 30 days
How it works, in short
A malicious repository's worktree layout and symlinks let git's fsmonitor hook run outside the sandbox and overwrite a shell startup file in the home directory. (Our summary, written by a model. The source text is below.)
Details
Claude Code's worktree handling allowed creation of worktrees named ".git" and navigation to worktrees outside the sandbox context, enabling git directory confusion attacks. By exploiting symlink manipulation and git fsmonitor execution during worktree operations, an attacker could overwrite files in the user's home directory (such as .zshenv), leading to code execution outside of seatbelt sandbox restrictions. Reliably exploiting this required the user to clone a malicious repository containing prompt injection content and run Claude Code against it.
Users on standard Claude Code auto-update have received this fix automatically. Users performing manual updates are advised to update to the latest version.
Thank you to hackerone.com/metnew for reporting this issue.
References
- https://github.com/anthropics/claude-code/security/advisories/GHSA-7835-87q9-rgvv
- https://nvd.nist.gov/vuln/detail/CVE-2026-55607
- https://github.com/anthropics/claude-code
- https://github.com/anthropics/claude-code/releases/tag/v2.1.163
Source: GitHub Advisory Database, used under CC BY 4.0.