CVE-2026-55607: Claude Code Sandbox Escape Vulnerability

HIGH
Advisory Identifier: GHSA-7835-87q9-rgvv
CWE-78 CWE-59 CWE-22
Published
Advisory Summary

CVE-2026-55607 is a HIGH sandbox escape vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Claude Code libraries in the npm ecosystem. The issue involves sandbox escape via git worktree path confusion allows unsandboxed code execution. Remediation is available by upgrading affected packages to version 2.1.163.

CVE-2026-55607 at a Glance

CVE Identifier CVE-2026-55607
GHSA Identifier GHSA-7835-87q9-rgvv
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Claude Code
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-55607

To remediate this vulnerability, upgrade all affected Claude Code dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@anthropic-ai/claude-code fixed: 2.1.163
npm install @anthropic-ai/claude-code@2.1.163
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @anthropic-ai/claude-code

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-55607, inspect your project dependencies using npm:

npm ls @anthropic-ai/claude-code

Analyze the terminal output to locate any version of Claude Code in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.163), your application is affected.

Note: The npm ls @anthropic-ai/claude-code command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Claude Code, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2026-55607 Affected Claude Code Versions

1 component(s)
Fixed Versions:
2.1.163
Product / Package Ecosystem Affected Versions Fixed Version
@anthropic-ai/claude-code
npm
≥ 2.1.38
< 2.1.163
2.1.163

References

Frequently Asked Questions

What is CVE-2026-55607?
CVE-2026-55607 is a security vulnerability in Claude Code involving Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Claude Code versions are affected?
Affected versions include releases prior to 2.1.163 across affected packages: @anthropic-ai/claude-code.
What version fixes CVE-2026-55607?
Upgrading to 2.1.163 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @anthropic-ai/claude-code affected?
Yes, @anthropic-ai/claude-code is affected in releases prior to 2.1.163. Upgrade your dependency to 2.1.163 or later.
What CWE is associated with CVE-2026-55607?
CVE-2026-55607 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2026-55607?
Run the dependency tree command: 'npm ls @anthropic-ai/claude-code'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7835-87q9-rgvv",
  "modified" : "2026-07-24T16:54:09Z",
  "published" : "2026-07-24T16:54:09Z",
  "aliases" : [ "CVE-2026-55607" ],
  "summary" : "Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution",
  "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.\n\nUsers on standard Claude Code auto-update have received this fix automatically. Users performing manual updates are advised to update to the latest version.\n\nThank you to hackerone.com/metnew for reporting this issue.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@anthropic-ai/claude-code"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.38"
      }, {
        "fixed" : "2.1.163"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/anthropics/claude-code/security/advisories/GHSA-7835-87q9-rgvv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-55607"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/anthropics/claude-code"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/anthropics/claude-code/releases/tag/v2.1.163"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-59", "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T16:54:09Z",
    "nvd_published_at" : "2026-06-29T15:16:41Z"
  }
}