CVE-2026-25725: @anthropic ai/claude code Claude Code Has Sandbox Escape Vulnerability
HIGHCVE-2026-25725 is a HIGH claude code has sandbox escape vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting @anthropic ai/claude code libraries in the npm ecosystem. The issue involves claude code has sandbox escape via persistent configuration injection in settings.json. Remediation is available by upgrading affected packages to version 2.1.2.
CVE-2026-25725 at a Glance
How to Fix CVE-2026-25725
To remediate this vulnerability, upgrade all affected @anthropic ai/claude code dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @anthropic-ai/claude-code@2.1.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @anthropic-ai/claude-code
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-25725, inspect your project dependencies using npm:
npm ls @anthropic-ai/claude-code
Analyze the terminal output to locate any version of @anthropic ai/claude code in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.2), your application is affected.
Note: The npm ls @anthropic-ai/claude-code command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In @anthropic ai/claude code, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-25725 Affected @anthropic ai/claude code Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@anthropic-ai/claude-code
|
npm |
< 2.1.2
|
2.1.2
|
References
Frequently Asked Questions
What is CVE-2026-25725?
Which @anthropic ai/claude code versions are affected?
What version fixes CVE-2026-25725?
Is @anthropic-ai/claude-code affected?
What CWE is associated with CVE-2026-25725?
How can I check npm dependencies for CVE-2026-25725?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-ff64-7w26-62rf",
"modified" : "2026-02-06T19:14:33Z",
"published" : "2026-02-06T19:14:33Z",
"aliases" : [ "CVE-2026-25725" ],
"summary" : "Claude Code has Sandbox Escape via Persistent Configuration Injection in settings.json",
"details" : "Claude Code's bubblewrap sandboxing mechanism failed to properly protect the .claude/settings.json configuration file when it did not exist at startup. While the parent directory was mounted as writable and .claude/settings.local.json was explicitly protected with read-only constraints, settings.json was not protected if it was missing. This allowed malicious code running inside the sandbox to create this file and inject persistent hooks (such as SessionStart commands) that would execute with host privileges when Claude Code was restarted. \n\nUsers on standard Claude Code auto-update received this fix automatically. Users performing manual updates are advised to update to the latest version.\n\nClaude Code thanks hackerone.com/edbr for reporting this issue!",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@anthropic-ai/claude-code"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/anthropics/claude-code/security/advisories/GHSA-ff64-7w26-62rf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-25725"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/anthropics/claude-code"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-501", "CWE-668" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-06T19:14:33Z",
"nvd_published_at" : "2026-02-06T18:16:00Z"
}
}