Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-78.
Summary
Claude Code is an agentic coding tool. From 2.1.38 until 2.1.163, 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. This vulnerability is fixed in 2.1.163.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| anthropics | claude-code | 2.1.38 to before 2.1.163 | 2.1.163 | Patch available | CNA |
| — | @anthropic-ai/claude-code (npm) | 2.1.38 to before 2.1.163 | 2.1.163 | Patch available | GHSA-7835-87q9-rgvv |
- claude-code Vendoranthropics Affected 2.1.38 to before 2.1.163 Fixed in 2.1.163 Patch available CNA
- @anthropic-ai/claude-code (npm) Vendor— Affected 2.1.38 to before 2.1.163 Fixed in 2.1.163 Patch available GHSA-7835-87q9-rgvv
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:* | 2.1.38 to before 2.1.163 | Vulnerable | anthropics |
- cpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:* Versions 2.1.38 to before 2.1.163 Vulnerable ·anthropics
Remediation
- Fix · CNA claude-code (anthropics) Fixed in 2.1.163
- Fix · GHSA-7835-87q9-rgvv @anthropic-ai/claude-code (npm) Fixed in 2.1.163 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| OpenShift Lightspeed | Affected | No fix yet |
Timeline
- 2026-10-02 Threatist record created from CVE-2026-55607
- 2026-10-03 Alias added: GHSA-7835-87q9-rgvv
References
More anthropics Claude Code vulnerabilities
- TI-2025-40558 Claude Code Command Validation Bypass Allows Arbitrary Code Execution CVSS 4.0HIGH 8.7
- TI-2025-36683 Claude Code vulnerable to arbitrary code execution caused by maliciously configured git email CVSS 4.0HIGH 8.7
- TI-2025-37066 Claude Code's startup trust dialog could lead to Command Execution attack CVSS 4.0HIGH 8.7
- TI-2026-17554 Claude Code Leaks Data via Malicious Environment Configuration Before Trust Confirmation CVSS 4.0MEDIUM 5.3
- TI-2025-40093 @anthropic-ai/claude-code has Sed Command Validation Bypass that Allows Arbitrary File Writes CVSS 4.0HIGH 8.7
- TI-2025-36422 Claude Code rg command had Command Injection that allowed bypass of user approval prompt for command execution CVSS 4.0HIGH 8.7
Sources
- CVE-2026-55607 · CVE Program
- CVE-2026-55607 · NVD
- FIRST EPSS
- GHSA-7835-87q9-rgvv · GitHub Advisory Database · CC BY 4.0
- CVE-2026-55607 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences