CVE-2026-39861
JSON

7.7high

Claude Code: Sandbox Escape via Symlink Following Allows Arbitrary File Write Outside Workspace

Severity
7.7high CVSS:4.0 by GitHub_M
Exploit likelihood
0.72% (higher than 55% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-vp62-r36r-9xqp

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.

Affected

Product or packageVersionsReported by
anthropics claude-code< 2.1.64CVE List
@anthropic-ai/claude-code (npm)before 2.1.64GitHub Advisory Database
anthropic claude_codebefore 2.1.64NVD

All scores

GitHub_M7.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHub10.0high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
NVD10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-22CWE-61

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database

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 the latest version.

Claude Code thanks hackerone.com/philts for reporting this issue.

NVD (es)

Claude Code es una herramienta de codificación agéntica. Antes de la versión 2.1.64, el sandbox de Claude Code no impedía que los procesos en sandbox crearan enlaces simbólicos que apuntaban a ubicaciones fuera del espacio de trabajo. Cuando Claude Code posteriormente escribía en una ruta dentro de dicho enlace simbólico, su proceso no aislado seguía el enlace simbólico y escribía en la ubicación de destino fuera del espacio de trabajo sin solicitar confirmación al usuario. Esto permitía un escape de sandbox donde ni el comando en sandbox ni la aplicación no aislada podían escribir de forma independiente fuera del espacio de trabajo, pero su combinación podía escribir en ubicaciones arbitrarias, lo que podría llevar a la ejecución de código fuera del sandbox. La explotación fiable de esto requería la capacidad de añadir contenido no confiable en una ventana de contexto de Claude Code para activar la ejecución de código en sandbox mediante inyección de prompt. Los usuarios con la actualización automática estándar de Claude Code han recibido esta corrección automáticamente. Se aconseja a los usuarios que realizan actualizaciones manuales actualizar a la versión 2.1.64 o posterior.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-39861 changed 2026-04-21CVE Terms of Use
GitHub Advisory DatabaseGHSA-vp62-r36r-9xqp changed 2026-05-05CC-BY-4.0
NVDCVE-2026-39861 changed 2026-10-26Public domain