CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-39861

CVE-2026-39861: Sandbox Escape via Symlink Following in Anthropic Claude Code

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 21, 2026·6 min read·354 visits

Executive Summary (TL;DR)

A symlink following vulnerability in Claude Code < 2.1.64 allows an attacker to write arbitrary files on the host system. Exploitation requires a prompt injection attack to trick the agent into creating a malicious symlink and writing to it.

Claude Code versions prior to 2.1.64 contain a sandbox escape vulnerability due to improper handling of symbolic links. Sandboxed processes can create symlinks pointing outside the designated workspace, which the unsandboxed host process subsequently follows during file write operations. This enables arbitrary file writes on the host system, typically exploited via prompt injection.

Vulnerability Overview

Claude Code is an agentic coding tool that executes commands within a restricted sandbox environment to prevent unintended modifications to the host system. The sandbox is designed to isolate the AI agent's operations, restricting file system access to a designated workspace directory. This isolation is critical for safely processing untrusted context or executing code generated by the language model.

In versions prior to 2.1.64, the security boundary between the restricted sandbox and the privileged host process contained a fundamental flaw. The sandbox environment failed to prevent the creation of symbolic links. Sandboxed processes could freely execute commands such as ln -s to create symlinks pointing to arbitrary locations outside the designated workspace directory.

While creating the symlink itself does not directly compromise the system, the vulnerability manifests during subsequent file operations. The unsandboxed host process, which manages file persistence with the full privileges of the user, processes file write requests generated by the agent. This host process did not adequately validate the canonicalized path of the target file, resulting in a classic Symlink Following vulnerability (CWE-61).

When the agent requests a write operation to a path within the workspace that is actually a symlink, the unsandboxed host process blindly follows the link. This combined failure allows an attacker to achieve arbitrary file writes outside the workspace, completely bypassing the intended sandbox restrictions.

Root Cause Analysis

The vulnerability stems from a two-part failure in the application's architectural security boundary. The primary flaw resides in the permissive nature of the sandbox environment. The execution constraints placed on the agent did not filter or hook system calls related to symbolic link creation, permitting the unrestricted execution of the UNIX ln command within the workspace.

The secondary, critical flaw exists in the unsandboxed main Claude Code application. This host process handles file writing operations on behalf of the agent to persist changes. It utilized standard file system APIs, such as Node.js fs.writeFile or equivalent native functions. By default, these standard APIs automatically traverse symbolic links to write to the ultimate target destination.

The host process implemented a flawed authorization check. It verified that the requested write path logically resided within the workspace directory string, but it failed to canonicalize the path before performing this verification. Without utilizing functions like fs.realpath to resolve all symbolic links and verify the final absolute path against the workspace boundary, the host process lacked true visibility into the actual write destination.

Exploitation Methodology

Exploiting this vulnerability requires chaining the symlink flaw with a Prompt Injection attack. The attacker must introduce malicious instructions into the Claude Code context window. This is typically achieved by placing untrusted content into a file the agent will process, such as a repository's README.md, an issue description, or downloaded web snippets.

The injected prompt overrides the agent's system instructions and dictates a specific sequence of actions. The first required action instructs the agent to create a symbolic link within the current workspace. For example, the prompt commands the execution of ln -s /home/user/.ssh/authorized_keys ./temp_workspace_link. The sandbox permits this operation, establishing the bridge to the host system.

The second required action triggers the vulnerability. The prompt instructs the agent to utilize its file-writing capability to output specific data to the newly created ./temp_workspace_link. The agent constructs the write request containing the attacker's payload, such as a malicious SSH public key, and forwards it to the host process.

The privileged host process receives the request, determines that ./temp_workspace_link is a permitted path string, and initiates the write operation. The operating system transparently resolves the symlink, routing the attacker's payload to /home/user/.ssh/authorized_keys. The host process completes the operation without prompting the user for confirmation.

Impact Assessment

The direct impact of CVE-2026-39861 is arbitrary file write capability on the host system. The attacker achieves the exact privileges of the user executing the Claude Code application. This fundamentally breaks the core security promise of the sandbox, exposing the entire host environment to malicious modifications.

Arbitrary file writes frequently lead to total system compromise. By overwriting specific configuration files, an attacker can establish persistent access or achieve arbitrary code execution. Common targets include ~/.ssh/authorized_keys for remote SSH access, ~/.bashrc or ~/.zshrc for command execution upon the next terminal session, or modifying existing system binaries and scripts in the user's $PATH.

The vulnerability holds a CVSS 4.0 score of 7.7, categorized as High severity. The vector string 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 accurately reflects the required attack conditions. The Attack Vector is Network (N) due to the reliance on untrusted external context, and Attack Requirements are Present (P) because the attacker requires the prompt injection payload to be processed.

User Interaction is categorized as Passive (P). The user must initiate the Claude Code tool within a project containing the malicious context. However, the user is entirely unaware of the subsequent malicious actions, as the host process does not generate confirmation prompts when traversing the symlinks created by the sandboxed agent.

Remediation and Detection

The definitive remediation for CVE-2026-39861 is updating the Claude Code installation. Anthropic addressed this vulnerability in version 2.1.64. Users utilizing standard package managers should execute npm install -g @anthropic-ai/claude-code@latest to ensure the patched version is installed and active on their systems.

The architectural fix requires strict path canonicalization within the unsandboxed host process. Before opening any file handles or initiating write operations, the host process must resolve the intended target path using functions equivalent to Node.js fs.realpath. The resulting absolute path must then be explicitly verified to ensure it resides entirely within the designated workspace directory boundary.

Security and detection engineering teams can implement monitoring to identify exploitation attempts. Endpoint Detection and Response (EDR) solutions should flag the execution of the ln -s command originating from the claude binary or its associated child process trees. This behavior is anomalous within standard AI agent workflows and serves as a strong indicator of compromise.

Additionally, File Integrity Monitoring (FIM) should be configured to alert on unexpected modifications to sensitive user profile directories. Unexpected writes to ~/.ssh/, shell configuration files, or sensitive environment variable files originating from Node.js processes associated with Claude Code should trigger immediate security review.

Official Patches

AnthropicGitHub Security Advisory GHSA-vp62-r36r-9xqp

Technical Appendix

CVSS Score
7.7/ 10
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 Systems

macOS host systems running Claude Code < 2.1.64Linux host systems running Claude Code < 2.1.64Windows host systems (WSL/native) running Claude Code < 2.1.64

Affected Versions Detail

Product
Affected Versions
Fixed Version
claude-code
Anthropic
< 2.1.642.1.64
AttributeDetail
CWE IDCWE-61
Attack VectorNetwork
CVSS Score7.7
ImpactArbitrary File Write
Exploit StatusProof of Concept
Required InteractionPassive User Interaction

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
T1059Command and Scripting Interpreter
Execution
T1485Data Destruction
Impact
CWE-61
UNIX Symbolic Link (Symlink) Following

The software allows a symbolic link to be created or accessed, but it fails to properly verify that the symlink does not resolve to an unintended location.

Vulnerability Timeline

Fix implemented and version 2.1.64 released to production.
2026-03-02
Official CVE (CVE-2026-39861) and GitHub Security Advisory published.
2026-04-21

References & Sources

  • [1]Official Advisory GHSA-vp62-r36r-9xqp
  • [2]NVD Record CVE-2026-39861
  • [3]GitHub Repository anthropics/claude-code
  • [4]Anthropic Security Portal

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•6 days ago•CVE-2026-87697
8.8

CVE-2026-87697: Untrusted Deserialization in .NET PresentationCore Clipboard Handling

A remote code execution vulnerability exists in Microsoft .NET due to untrusted data deserialization within the PresentationCore component. The flaw stems from implicit auto-conversion flags during clipboard data retrieval operations.

Alon Barad
Alon Barad
23 views•5 min read
•6 days ago•CVE-2026-70007
8.8

CVE-2026-70007: Out-of-Bounds Write Vulnerability in .NET Framework and WPF Subsystem

An out-of-bounds write vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio allows unauthenticated remote attackers to execute arbitrary code via crafted pixel-shader bytecode or auto-converted clipboard payloads.

Amit Schendel
Amit Schendel
12 views•6 min read
•6 days ago•CVE-2026-70186
7.5

CVE-2026-70186: ASP.NET Core Denial of Service Vulnerability via Framework Deadlock

ASP.NET Core contains a thread deadlock vulnerability (CWE-833) that allows an unauthenticated remote attacker to cause a denial of service over the network by exhausting server thread pool resources.

Amit Schendel
Amit Schendel
15 views•5 min read
•6 days ago•CVE-2026-70035
8.8

CVE-2026-70035: Insecure Deserialization Remote Code Execution in Microsoft .NET Framework and .NET Runtime

CVE-2026-70035 is a high-severity Remote Code Execution (RCE) vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio caused by improper handling during the deserialization of untrusted data (CWE-502). An unauthenticated attacker can execute arbitrary code within the context of the affected process by delivering a crafted serialized payload.

Amit Schendel
Amit Schendel
18 views•6 min read
•6 days ago•CVE-2026-70183
7.5

CVE-2026-70183: Elevation of Privilege in ASP.NET Core and Visual Studio via Concurrent Race Condition

An elevation of privilege vulnerability exists in ASP.NET Core and Microsoft Visual Studio due to improper synchronization during concurrent thread execution. Authenticated remote attackers with low privileges can exploit a timing window to manipulate shared resources and assume higher-level execution contexts.

Alon Barad
Alon Barad
18 views•5 min read
•9 days ago•CVE-2026-107844
5.3

CVE-2026-107844: Path Traversal Vulnerability in Contao ImagesController

A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.

Amit Schendel
Amit Schendel
23 views•5 min read