Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessDeliver malicious repository or dependency script
-
DeliveryUser runs Claude Code on macOS
-
ExploitAttacker code executes in Bash sandbox
-
ExecutionSwap validated parent dir with symlink (TOCTOU)
-
ImpactEdit follows symlink, overwrites file outside workspace
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Symlink resolution safety
|
| Exploitation Conditions | Exploitation requires all of: a macOS host; a Claude Code version earlier than 2.1.251; attacker-controlled code already executing inside Claude Code's Bash sandbox (delivered via a malicious repository or a dependency/install script); the user invoking the Edit tool against an in-workspace path (the UI:P/user-interaction element); and successfully winning the TOCTOU race by atomically replacing the just-validated in-workspace parent directory with a symlink before the unsandboxed Edit write occurs. Limiting factors that reduce real-world risk: it is macOS-only, it presupposes the attacker has already achieved code execution within the sandbox, the overwrite is confined to user-writable files, and it depends on reliably winning a timing window rather than a deterministic single-shot trigger. |
| Impact | This is a genuine but conditional integrity risk rather than a broad remote threat. The vendor-supplied CVSS 4.0 vector scores 7.7 (High) with AV:N/AC:L/AT:P/PR:N/UI:P and VC:H/VI:H/VA:H, but the mechanism described contradicts a pure network-vector reading: exploitation explicitly requires 'attacker-controlled code to run inside the sandbox,' which is a local code-execution precondition, so the AV:N label likely reflects the malicious-repository delivery path rather than the point of exploitation - verify intent with the vendor. The AT:P (attack-requirements present) metric is grounded in evidence: the GHSA advisory (CWE-367) confirms this is a TOCTOU race requiring the attacker to atomically swap an in-workspace parent directory with a symlink within the time-of-check-to-time-of-use window, so the 'low complexity' feel is offset by the need to win a race. No EPSS score, no CISA KEV listing, and no public exploit reference were provided; the issue was reported privately via HackerOne (Sunder Singh / mahoraga007), so there is no evidence of in-the-wild or widespread exploitation. The vuln.today priority is 'this_week' (not act_now/emergency), consistent with a serious sandbox-escape primitive that nonetheless depends on a non-trivial local foothold and is confined to macOS. Net: a real priority to patch for macOS users of affected versions, but not a mass-exploitation emergency. |
| Exploit ScenarioDerived | A developer on macOS opens or runs a malicious repository (or a dependency install/script) under an affected Claude Code version; the attacker's code, executing inside the Bash sandbox, waits for the Edit tool to validate a target path and then atomically replaces a just-validated in-workspace parent directory with a symlink. The unsandboxed Edit implementation then follows the symlink and overwrites an attacker-chosen user-writable file outside the workspace, which can be leveraged (e.g., overwriting a shell rc file) toward broader code execution. No public exploit was identified at time of analysis; the flaw was reported privately through HackerOne. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 03, 2026
A time-of-check to time-of-use race in Claude Code's Edit tool before version 2.1.251 allows attacker-controlled code already running inside the macOS Bash sandbox to swap a validated in-workspace parent directory for a symlink, causing the unsandboxed Edit implementation to overwrite an attacker-chosen user-writable file outside the workspace. This is a genuine but conditional integrity risk rather than a broad remote threat: it is macOS-only, presupposes the attacker has already achieved code execution inside the sandbox via a malicious repository or dependency script, requires the user to invoke Edit on an in-workspace path, and depends on reliably winning a timing window rather than a deterministic single-shot trigger. The flaw was fixed in 2.1.251, and auto-update users have already received it; no public exploit code was identified at time of analysis.
RemediationAI
Vendor-released patch: Claude Code 2.1.251. Update the @anthropic-ai/claude-code package to 2.1.251 or later; users on standard Claude Code auto-update have received this fix automatically, while users performing manual updates are advised to update to the latest version. If an immediate upgrade is not possible, the practical exposure reduction is to avoid running Claude Code with the Bash sandbox on untrusted repositories or dependency/install scripts that execute attacker-influenced code, and to avoid invoking Edit on workspace paths while such code is executing; both trade off functionality and do not fully eliminate the race, so upgrading remains the complete fix per the vendor advisory. Untrusted plugin marketplaces and symlinked search paths should likewise be avoided on older builds. Advisory and release references: https://github.com/anthropics/claude-code/security/advisories/GHSA-5xjx-9qx6-jcrv and https://github.com/anthropics/claude-code/releases/tag/v2.1.251.
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
The issue combines CWE-59 (link following) with CWE-367 (time-of-check to time-of-use). Claude Code's Edit tool validated target paths using point-in-time pathname and symlink resolution that was not bound to the underlying directory inode or file descriptor, so the validated path and the path actually used for the write could diverge. On macOS, a process in the Bash sandbox can atomically replace the just-validated in-workspace parent directory with a symlink during that window, and the unsandboxed Edit write then lands on a user-writable file outside the workspace. The trigger is a race between directory validation and the subsequent write, which is why the assessed vector is AC:H with UI:R while scope remains unchanged, confidentiality impact is limited, and integrity/availability impact is high. The upstream fix in 2.1.251 bound file tools to the validated object and also tightened adjacent path-handling issues: symlink swaps inside the working directory for Read, Write and Edit; plugin commands pointing outside the plugin directory; Grep and Glob failing to apply Read(...) deny rules through symlinked search paths; and a Workflow tool scriptPath read before the permission check.
Know when the next one hits your stack
- 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 code execution inside the sandbox (AV:L) and winning a TOCTOU race (AC:H); attacker supplies the repo but the user must run Claude Code (PR:N/UI:R); primary impact is arbitrary file overwrite (I:H/A:H), confidentiality only indirect (C:L).
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
2DescriptionCVE.org
Claude Code is an agentic coding tool. Prior to 2.1.251, the Edit tool validates a target using pathname and symlink resolution that is not bound to the underlying directory inode or file descriptor. On macOS, attacker-controlled code running in the Bash sandbox can atomically replace an in-workspace parent directory with a symlink after validation, causing the unsandboxed Edit implementation to overwrite a user-writable file outside the workspace. Exploitation requires attacker-controlled code to run inside the sandbox, such as from a malicious repository or dependency script. This issue is fixed in version 2.1.251.
Technical POC Analysis
The bug is CWE-59 (Improper Link Resolution Before File Access) exploited through CWE-367 (TOCTOU race), in the Edit tool of the npm package @anthropic-ai/claude-code.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
A high-severity integrity vulnerability in Anthropic's Claude Code (before version 2.1.251) on macOS could allow an attacker who already has code execution inside the tool's Bash sandbox to overwrite user-writable files outside the workspace through a timing attack on the Edit tool. While exploitation is conditional and requires pre-existing compromise, the risk is elevated for development teams using Claude Code on macOS with untrusted repositories or dependencies, as it could lead to data tampering or further compromise. Leadership should prioritize patching to close this privilege escalation path and reduce exposure from malicious code that may already be present.
No vendor-released patch identified at time of analysis
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
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
EUVD-2026-116209
NVD
CVE.org
Vulnrichment
GitHub
Exploit-DB