CVE-2026-39861
published 2026-04-21CVE-2026-39861: Claude Code is an agentic coding tool. Prior to version 2.1.64, Claude Code's sandbox did not prevent sandboxed processes from creating symlinks pointing to…
PriorityP265critical10CVSS 3.1
AVNACLPRNUINSCCHIHAH
EPSS
0.80%
54.8th percentile
Claude Code is an agentic coding tool. Prior to version 2.1.64, Claude Code's sandbox did not prevent sandboxed processes from creating symlinks pointing to locations outside the workspace. When Claude Code subsequently wrote to a path within such a symlink, its unsandboxed process followed the symlink and wrote to the target location outside the workspace without prompting the user for confirmation. This allowed a sandbox escape where neither the sandboxed command nor the unsandboxed app could independently write outside the workspace, but their combination could write to arbitrary locations, potentially leading to code execution outside the sandbox. Reliably exploiting this required the ability to add untrusted content into a Claude Code context window to trigger sandboxed code execution via prompt injection. Users on standard Claude Code auto-update have received this fix automatically. Users performing manual updates are advised to update to version 2.1.64 or later.
Affected
3 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| anthropic-ai | claude-code | >= 0 < 2.1.64 | 2.1.64 |
| anthropic | claude_code | < 2.1.64 | 2.1.64 |
| anthropics | claude-code | < 2.1.64 | 2.1.64 |
Detection & IOCsextracted from sources · hover to see the quote
- →Monitor for Claude Code's sandboxed process creating symlinks pointing outside the workspace directory — this is the core primitive of CVE-2026-39861. ↗
- →Alert when Claude Code (unsandboxed process) writes to a path that resolves through a symlink to a location outside the designated workspace boundary. ↗
- →Watch for agent execution of binaries or scripts that were only referenced in README.md or documentation files — not called by any project source code — as this is the prompt-injection delivery pattern used to trigger the sandbox escape. ↗
- →Detect hidden binaries disguised as compiled Go build artifacts seeded with strings from a legitimate Go source file to evade disassembly checks by the agent. ↗
- →Flag prompt-injection strings in README.md files that instruct an AI agent to run a shell script as a 'security check' or pre-PR step, matching the pattern used in the Friendly Fire PoC. ↗
- →Audit symlink creation events (e.g., via auditd or Sysmon) inside Claude Code workspace directories, especially those whose targets resolve outside the workspace root. ↗
- ·CVE-2026-39861 is fixed in Claude Code version 2.1.64 and later; users on auto-update received the fix automatically, but manual-update users must upgrade explicitly. ↗
- ·Reliable exploitation of CVE-2026-39861 requires the ability to inject untrusted content into a Claude Code context window to trigger sandboxed code execution via prompt injection — e.g., through a poisoned repository. ↗
- ·The Friendly Fire PoC (related prompt-injection attack) targets Claude Code auto-mode and Codex auto-review; the attack surface is bounded to agents reviewing untrusted third-party code in these autonomous modes. ↗
- ·Stricter agent modes that prompt before each step prevent the Friendly Fire attack but eliminate the automation benefit; the sandbox alone is not a reliable containment boundary given escape bugs like CVE-2026-39861. ↗
CVSS provenance
nvdv3.110.0CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
nvdv4.07.7HIGHCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
Claude Code: Sandbox Escape via Symlink Following Allows Arbitrary File Write Outside Workspace
ghsa·2026-04-21
CVE-2026-39861 [HIGH] CWE-22 Claude Code: Sandbox Escape via Symlink Following Allows Arbitrary File Write Outside Workspace
Claude Code: Sandbox Escape via Symlink Following Allows Arbitrary File Write Outside Workspace
Claude Code's sandbox did not prevent sandboxed processes from creating symlinks pointing to locations outside the workspace. When Claude Code subsequently wrote to a path within such a symlink, its unsandboxed process followed the symlink and wrote to the target location outside the workspace without prompting the user for confirmation. This allowed a sandbox escape where neither the sandboxed command nor the unsandboxed app could independently write outside the workspace, but their combination could write to arbitrary locations, potentially leading to code execution outside the sandbox. Reliably exploiting this required the ability to add untrusted content into a Claude Code context window to
VulDB
Anthropic claude-code up to 2.1.63 Symlink path traversal (GHSA-vp62-r36r-9xqp / EUVD-2026-24033)
vuldb·2026-04-21·CVSS 7.7
CVE-2026-39861 [HIGH] Anthropic claude-code up to 2.1.63 Symlink path traversal (GHSA-vp62-r36r-9xqp / EUVD-2026-24033)
A vulnerability described as critical has been identified in Anthropic claude-code up to 2.1.63. The impacted element is an unknown function of the component Symlink Handler. The manipulation results in path traversal.
This vulnerability was named CVE-2026-39861. The attack may be performed from remote. There is no available exploit.
Upgrading the affected component is recommended.
No detection rules found.
No public exploits indexed.
2026-04-21
Published