High (AgentArmorHQ estimate)Sandbox escape

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

  1. Upgrade to the fixed version: run npm install @anthropic-ai/claude-code@2.1.163 (first patched version 2.1.163). [1]
  2. Upgrade to version 2.1.163. [1]
  3. 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.

Discuss this incident

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

  • An attacker could overwrite files in the user's home directory (such as .zshenv). [1]
  • Code execution outside of seatbelt sandbox restrictions could result. [1]

What was done

  • Users on standard Claude Code auto-update have received this fix automatically. [1]
  • Users performing manual updates are advised to update to the latest version. [1]

Sources

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

Brief
[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-code
Was this page useful?

Corrections

Report an error or request a correction. We review requests within 5 business days and add a dated correction note.

10 to 2,000 characters. A link to a source helps. Stored as plain text.

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.

Check before you install

Paste a package name or a GitHub link and get a clear answer in seconds: Block, Review or No known issues. No account needed.

Check a package

Questions? Contact us