---
id: CVE-2026-55607
aliases:
  - GHSA-7835-87q9-rgvv
title: >-
  Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed
  Code Execution
summary: >-
  Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed
  Code Execution
severity: high
cwe:
  - CWE-22
  - CWE-59
  - CWE-78
vendor: anthropic-ai
product: '@anthropic-ai/claude-code'
ecosystem: npm
affected:
  - '@anthropic-ai/claude-code >= 2.1.38, < 2.1.163'
patched:
  - '@anthropic-ai/claude-code 2.1.163'
published: '2026-07-24'
updated: '2026-07-24'
source: GHSA
sourceUrl: 'https://github.com/advisories/GHSA-7835-87q9-rgvv'
references:
  - url: >-
      https://github.com/anthropics/claude-code/security/advisories/GHSA-7835-87q9-rgvv
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-55607'
  - url: 'https://github.com/anthropics/claude-code/releases/tag/v2.1.163'
  - url: 'https://github.com/advisories/GHSA-7835-87q9-rgvv'
tags:
  - ghsa
  - npm
epss: 0.00687
epssPercentile: 0.50582
ingestedAt: '2026-07-24T17:34:27.459Z'
---

## Overview

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.

## Affected packages

- `@anthropic-ai/claude-code >= 2.1.38, < 2.1.163`

## Remediation

Upgrade to a patched release:

- `@anthropic-ai/claude-code 2.1.163`
