Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution
- Product
- @anthropic-ai/claude-code
- CVE
- CVE-2026-55607
- Affected
- @anthropic-ai/claude-code >= 2.1.38, < 2.1.163
- Fixed in
- 2.1.163
Last verified against sources: October 26, 2026
Am I affected?
@anthropic-ai/claude-code: affected @anthropic-ai/claude-code >= 2.1.38, < 2.1.163. Fixed in 2.1.163.
- Check your version: run
npm ls @anthropic-ai/claude-code. Versions >= 2.1.38, < 2.1.163 of @anthropic-ai/claude-code are affected. [1]
What to do now
- Upgrade to the fixed version: run
npm install @anthropic-ai/claude-code@2.1.163(first patched version 2.1.163). [1] - Upgrade to version 2.1.163. [1]
- If performing manual updates, update to the latest version. [1]
General practice, not from the source: if the affected software could read tokens or credentials, rotate them after upgrading; pin versions and review changes before updating tools your agents run.
What happened
- Claude Code's worktree handling allowed creation of worktrees named ".git" and navigation to worktrees outside the sandbox context, enabling git directory confusion attacks. [1]
- Reliably exploiting this required the user to clone a malicious repository containing prompt injection content and run Claude Code against it. [1]
Impact
What was done
Sources
- GHSA-7835-87q9-rgvv — GitHub Advisory Database
Every statement above was checked against these sources before publishing. Spotted an error? Tell us and we will correct it with a dated note.
Share advisory brief with your team
Copy a plain-text summary for Slack, GitHub issues, or team security channels.
[CVE-2026-55607] Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution
Product: @anthropic-ai/claude-code | Affected: @anthropic-ai/claude-code >= 2.1.38, < 2.1.163 | Fixed in: 2.1.163
Summary: Claude Code's worktree handling allowed creation of worktrees named ".git" and navigation to worktrees outside the sandbox context, enabling git directory confusion attacks.
Source & remediation on AgentArmorHQ: https://agentarmorhq.com/incidents/2026/07/cve-2026-55607-anthropic-ai-claude-codeCorrections
Report an error or request a correction. We review requests within 5 business days and add a dated correction note.
Discussions for CVE-2026-55607
Ask questions or share configuration tips. Governed by our Community Rules & Terms.
No posts match this filter yet.
Be the first to ask a question or share a working tip.