Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain write access to shared workspace
-
DeliveryMonitor Claude Code permission check on target file
-
ExploitWin race to swap file for symlink
-
ExecutionClaude Code follows symlink past TOCTOU gap
-
PersistWrite redirected to shell config outside sandbox
-
ImpactEscalate into higher-privileged session
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires all of: (1) write access to a workspace directory shared between the attacker and a higher-privileged Claude Code session (e.g., a multi-user dev host, container, or CI runner); (2) the ability to atomically replace a validated project file with a symlink in the narrow window between Claude Code's permission-time path validation and its write-time path re-resolution - i.e., winning a TOCTOU race; and (3) a higher-privileged Claude Code session actually performing a write/edit to the targeted path so the symlink is followed. Limiting factors that reduce real-world risk: single-user installations with no shared workspace are not exposed; the attacker must already hold local write access to the workspace; success depends on winning a timing race rather than a deterministic trigger; and the fix is already distributed automatically to users on standard Claude Code auto-update, leaving only manual-update holdouts exposed. |
| Impact | This is a credible but situationally-bounded risk rather than a mass-exploitation emergency. The vendor-supplied CVSS 4.0 vector (7.7 High) lists AV:N/AC:L/PR:N/UI:P with full VC/VI/VA:H, but this score is in tension with the described mechanics: the attack is a TOCTOU symlink race that requires the attacker to already have write access to a shared workspace and to win a race against the victim's write - signals that point to local, authenticated-adjacent, higher-complexity exploitation (AT:P is correctly flagged for the race requirement). The AV:N/PR:N framing is therefore optimistic; realistic exploitation is a local multi-user privilege-escalation primitive, not a remote unauthenticated takeover. No EPSS score, no CISA KEV listing, and no public exploit were provided, so exploitation is 'no public exploit identified at time of analysis.' SSVC-style reasoning: exploitation=none observed, automatable=no (requires winning a timing race and a victim-triggered write), technical impact=total within the redirected-write scope. Net: a real priority to patch for anyone running Claude Code in shared/multi-tenant workspaces, but low likelihood of opportunistic mass exploitation. Note the PR:N claim conflicts with the description's explicit requirement for workspace write access - verify deployment context before trusting the network/unauthenticated framing. |
| Exploit ScenarioDerived | On a shared developer host or CI runner where a low-privileged user and a higher-privileged user both touch the same workspace, the attacker watches for Claude Code to validate a project file path, then atomically swaps that file for a symlink before the write occurs. Claude Code re-resolves and follows the symlink, writing attacker-influenced content to a sensitive file such as the victim's shell configuration (~/.bashrc), yielding code execution in the higher-privileged session. No public exploit code is identified at time of analysis, though the race window is the only non-trivial barrier. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 07, 2026
A time-of-check to time-of-use (TOCTOU) race condition in Anthropic's Claude Code CLI allows an attacker who already has write access to a shared project workspace to atomically replace a project file with a symlink after the agent has validated the path but before it writes, causing Claude Code to follow the link and write to an arbitrary file outside the sandbox - for example a shell configuration file that will later be sourced by a higher-privileged session. Exploitation is bounded: it requires local write access to a workspace shared with a more privileged Claude Code session, requires winning a narrow timing race rather than triggering deterministically, and requires the privileged session to actually perform a write to the targeted path; single-user installations with no shared workspace are not exposed. There is no indication of active exploitation (no CISA KEV listing) and no public exploit identified at time of analysis, though Anthropic has already shipped the fix through the standard auto-update channel, leaving only manual-update holdouts at risk.
RemediationAI
The authoritative fix is delivered by updating Claude Code: users on the standard auto-update channel have already received the patched build, and users who manage updates manually should update to the latest released version per the vendor advisory at https://github.com/anthropics/claude-code/security/advisories/GHSA-5j29-h97v-84ch - no exact fixed version string is published in the available data, so verify the installed version against the advisory rather than relying on a specific number here. This constitutes a vendor-released fix delivered through auto-update rather than a third-party workaround. Where immediate updating is not possible, the most effective compensating control is to remove the precondition: do not share a writable workspace between untrusted users and a higher-privileged Claude Code session - give each user or job its own workspace, and run the agent in a per-user container or VM with the workspace as the only writable mount and sensitive paths (home directory, ~/.bashrc, ~/.profile, ~/.ssh, system config) mounted read-only or not mounted at all, accepting the trade-off that the agent can no longer edit configuration outside the project. If the agent must run in a shared workspace, run the privileged session under a dedicated low-privilege account whose writable file set is disjoint from anything a higher-privileged shell sources, and drop write permission on shell startup files (chmod removing group/other write on ~/.bashrc, ~/.profile and similar) so a redirected write fails outright - the trade-off being that legitimate configuration edits then require an explicit privilege step. Additional detection-oriented measures, such as file-integrity monitoring or auditd rules on shell init files and symlink creation in workspace directories, can surface an attempted race but must not be treated as prevention. Restricting write access to the workspace to fully trusted principals remains the single mitigation that eliminates the attack, because the vulnerability cannot be reached without an attacker already holding that write access.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Claude Code is Anthropic's agentic command-line coding assistant (distributed as the npm package @anthropic-ai/claude-code, identified by the CPE cpe:2.3:a:anthropic:@anthropic-ai/claude-code:*:*:*:*:*:*:*:*), which reads, edits, and writes files inside a designated project working directory that it treats as a sandbox boundary. The flaw is an asymmetry between two path-handling steps: at permission-check time the tool canonicalized the target path and confirmed it resolved inside the project directory, but at write time it re-resolved the path from scratch without repeating that containment check. Between those two moments an attacker with workspace write access can use an atomic rename/symlink swap to substitute the validated file with a symbolic link pointing outside the project - the classic TOCTOU pattern. The advisory maps the issue to CWE-22 (improper limitation of a pathname to a restricted directory / path traversal), which describes the resulting out-of-sandbox write, although the underlying mechanism is more precisely a TOCTOU symlink-following race (CWE-367). The security consequence is sandbox escape for file writes only: integrity of the target file is destroyed, availability may be affected if the overwritten file is required (e.g., a corrupted shell init file), but there is no read primitive and no code execution directly attributable to the bug - code execution would be second-order, achieved only if the overwritten file is later executed or sourced by a higher-privileged process. Atomic replacement via rename is what makes the race winnable without leaving a partially written file that Claude Code could detect.
Know when Anthropic Ai Claude Code gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Requires local write access to a shared workspace (AV:L, PR:L) and winning a race (AC:H), a victim-triggered write (UI:R), and escapes the sandbox to affect a higher-privileged context (S:C, I:H).
Primary rating from Vendor (Anthropic).
CVSS VectorVendor: Anthropic
Lifecycle Timeline
2DescriptionCVE.org
Claude Code validated that a target file path resided within the project working directory at permission-check time, but re-resolved the path at write time without repeating that validation. This time-of-check to time-of-use (TOCTOU) gap allowed an attacker who could write to the workspace to atomically replace a project file with a symlink, causing Claude Code to follow the symlink and write its output to an arbitrary file outside the project sandbox. Exploitation required the ability to win a race condition against the write operation and write access to the shared workspace, enabling a lower-privileged attacker to redirect benign edits to sensitive files (e.g., shell configuration) in a higher-privileged session.
Users on standard Claude Code auto-update have received this fix already. Users performing manual updates are advised to update to the latest version.
Thank you to hackerone.com/c_h4ck_0 for reporting this issue.
Technical POC Analysis
Evidence base: the GHSA-5j29-h97v-84ch advisory text only.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
Anthropic's Claude Code CLI is affected by a high-severity TOCTOU race condition that can allow an attacker with local write access to a shared workspace to redirect the agent's file writes outside the intended sandbox, potentially overwriting shell configuration files later executed by a more privileged session. This primarily impacts organizations using Claude Code in multi-user or shared-workspace development environments, where a low-privileged user could escalate privileges or compromise developer endpoints. No public exploit identified at time of analysis, but leadership should prioritize restricting shared workspace access and monitoring for anomalous file writes until a vendor fix is available.
No vendor-released patch identified at time of analysis. Interim mitigations include: restrict write access to shared workspaces to trusted users only; run Claude Code sessions with minimal privileges and in isolated containers or VMs; use read-only bind mounts for project files; monitor for symlink creation and unexpected writes to shell configuration files; avoid mixing users with different privilege levels in the same workspace.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
EUVD-2026-94319
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB