CVE-2026-46406: @anthropic ai/claude code @anthropic-ai/claude-code Has An Insecure Temporary Vulnerability
MODERATECVE-2026-46406 is a MODERATE @anthropic-ai/claude-code has an insecure temporary vulnerability (CWE-377: Insecure Temporary File) affecting @anthropic ai/claude code libraries in the npm ecosystem. The issue involves @anthropic-ai/claude-code has an insecure temporary file in /copy command that enables response disclosure and symlink-based file write. Remediation is available by upgrading affected packages to version 2.1.128.
CVE-2026-46406 at a Glance
How to Fix CVE-2026-46406
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.128
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-46406, 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.128), 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-377: Insecure Temporary File, where creating and using insecure temporary files can leave application and system data vulnerable to attack. 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-46406 Affected @anthropic ai/claude code Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@anthropic-ai/claude-code
|
npm |
≥ 2.1.59
< 2.1.128
|
2.1.128
|
References
Frequently Asked Questions
What is CVE-2026-46406?
Which @anthropic ai/claude code versions are affected?
What version fixes CVE-2026-46406?
Is @anthropic-ai/claude-code affected?
What CWE is associated with CVE-2026-46406?
How can I check npm dependencies for CVE-2026-46406?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4vp2-6q8c-pvq2",
"modified" : "2026-06-25T16:53:00Z",
"published" : "2026-06-25T16:53:00Z",
"aliases" : [ "CVE-2026-46406" ],
"summary" : "@anthropic-ai/claude-code has an Insecure Temporary File in /copy Command that Enables Response Disclosure and Symlink-Based File Write",
"details" : "The Claude Code `/copy` command wrote responses to a hardcoded, predictable path (`/tmp/claude/response.md`) without UID isolation, randomness, or symlink protection. The file was created world-readable (0644) in a world-traversable directory (0755), allowing any local user to read a privileged user's Claude response, which could contain secrets or credentials. Additionally, because the path was static and predictable, a local attacker could pre-create the directory and plant a symlink at the expected file path, causing the privileged process to follow the symlink and overwrite an attacker-chosen file with the response text. Exploiting this required a local unprivileged user on the same system and a privileged user to run the `/copy` command.\n\nUsers on standard Claude Code auto-update have received this fix already. Users performing manual updates are advised to update to the latest version.\n\nClaude Code thanks hackerone.com/c_h4ck_0 for reporting this issue.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:A/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@anthropic-ai/claude-code"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.59"
}, {
"fixed" : "2.1.128"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/anthropics/claude-code/security/advisories/GHSA-4vp2-6q8c-pvq2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/anthropics/claude-code"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200", "CWE-377", "CWE-59" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-25T16:53:00Z",
"nvd_published_at" : null
}
}