CVE-2026-46406 — @anthropic-ai/claude-code
CVE-2026-46406 is a CWE-59 vulnerability in @anthropic-ai/claude-code. A fix is available for @anthropic-ai/claude-code — see the affected versions and patch details below.
Claude Code: Insecure Temporary File in /copy Command Enables Response Disclosure and Symlink-Based File Write
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-46406.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@anthropic-ai/claude-codenpmDescription
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.
Users on standard Claude Code auto-update have received this fix already. Users performing manual updates are advised to update to the latest version.
Claude Code thanks hackerone.com/c_h4ck_0 for reporting this issue.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @anthropic-ai/claude-code | ≥ 2.1.59&&< 2.1.128 | 2.1.128npm install @anthropic-ai/claude-code@2.1.128 |
Affected Products
claude codeanthropicDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @anthropic-ai/claude-code, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @anthropic-ai/claude-code to 2.1.128 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-46406 is resolved across your whole dependency graph.
Workarounds
Assume what was exposed is already known: rotate any credential, token or key that the affected component could return, restrict the endpoint to callers that genuinely need it, and strip sensitive fields from responses and error output at the boundary rather than relying on the client not to read them.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat rates this Moderate with a CVSS score of 6.8, higher than NIST's 6.1. The difference is in the confidentiality and integrity metrics. Claude Code responses might contain secrets, API keys, credentials, and code, which is why Red Hat scores confidentiality as High rather than Low. On integrity, the symlink…
Update Claude Code to version 2.1.128 or later, which uses randomized, UID-isolated temporary file paths with symlink protection. If updating is not immediately possible, avoid using the /copy command on multi-user systems where untrusted local users have access to /tmp.Source: Red Hat security advisory for CVE-2026-46406 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2026-46406 in your dependencies?
Find it across npm, including transitive dependencies.