CVE-2026-39861 Claude Code: Sandbox Escape via Symlink Following Allows Arbitrary File Write Outside Workspace

High 7.7 Published Updated

Attackers can escape the sandbox and write arbitrary files outside the workspace via symlink following, potentially leading to code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-39861?

CVE-2026-39861 is a high-severity path traversal vulnerability in anthropics claude-code, published on 21 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-61, CWE-22

Which versions are affected by CVE-2026-39861?

2 open source packages ship an affected version, including @anthropic-ai/claude-code. It affects 1 product.

PackageAffectedFixed in
@anthropic-ai/claude-code npmAll versions2.1.64
@anthropic-ai/claude-code npmAll versions2.1.64

Products include Anthropic Claude Code.

How do I fix CVE-2026-39861?

Upgrade @anthropic-ai/claude-code to 2.1.64 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2026-39861 being exploited?

There is no known exploitation of CVE-2026-39861 in the wild and no public exploit code.

Sources

Also known as GHSA-vp62-r36r-9xqp.

Is CVE-2026-39861 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free