CVE-2026-88968: Claude Code: TOCTOU symlink race lets sandbox escape file write
HIGHClaude Code's Edit tool checks a file path for safety but does not bind that check to the actual directory, so code running inside the Bash sandbox on macOS can swap a parent folder for a symlink after validation and make the unsandboxed Edit tool overwrite a user-writable file outside the workspace. This breaks the sandbox boundary that developers rely on when opening untrusted repositories or running dependency scripts. Exploitation needs attacker-controlled code to already run in the sandbox and a precisely timed race. There is no public exploit, no Nuclei template, no KEV listing and no EPSS score yet, so near-term mass exploitation is unlikely, but the vendor confirms the flaw (GHSA-5xjx-9qx6-jcrv) and the package has 25 other CVEs. Upgrade claude-code to 2.1.251 or later on all macOS developer machines, and treat untrusted repositories with extra caution until patched.
What is the risk?
High severity but with narrowing conditions: it affects macOS only, requires attacker-controlled code inside the Bash sandbox (for example from a malicious repository or dependency script), and needs a successful race condition (CWE-367) combined with link following (CWE-59). No CVSS vector, EPSS score or public exploit is available, and it is not in CISA KEV. The impact is arbitrary overwrite of any user-writable file outside the workspace, such as shell profiles, SSH config or Git hooks, which can lead to persistent code execution as the user. Exposure is concentrated on developer workstations, which often hold source code, cloud credentials and tokens.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Claude Code | npm | — | No patch |
Do you use Claude Code? You're affected.
How severe is it?
What should I do?
1 step1) Upgrade claude-code to 2.1.251 or later (npm update, then verify with claude --version) across all macOS developer machines and managed images. 2) Until patched, avoid opening untrusted repositories or running unreviewed dependency scripts with Claude Code. 3) Review and tighten permission settings so Edit and Bash actions require approval for unfamiliar projects. 4) Monitor for unexpected modifications to shell startup files (.zshrc, .zprofile), ~/.ssh/config, Git hooks and LaunchAgents, and for symlink swaps of directories inside workspaces. 5) Use endpoint detection to alert on rapid directory-to-symlink replacement patterns by processes spawned from Claude Code.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-88968?
Claude Code's Edit tool checks a file path for safety but does not bind that check to the actual directory, so code running inside the Bash sandbox on macOS can swap a parent folder for a symlink after validation and make the unsandboxed Edit tool overwrite a user-writable file outside the workspace. This breaks the sandbox boundary that developers rely on when opening untrusted repositories or running dependency scripts. Exploitation needs attacker-controlled code to already run in the sandbox and a precisely timed race. There is no public exploit, no Nuclei template, no KEV listing and no EPSS score yet, so near-term mass exploitation is unlikely, but the vendor confirms the flaw (GHSA-5xjx-9qx6-jcrv) and the package has 25 other CVEs. Upgrade claude-code to 2.1.251 or later on all macOS developer machines, and treat untrusted repositories with extra caution until patched.
Is CVE-2026-88968 actively exploited?
No confirmed active exploitation of CVE-2026-88968 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-88968?
1) Upgrade claude-code to 2.1.251 or later (npm update, then verify with claude --version) across all macOS developer machines and managed images. 2) Until patched, avoid opening untrusted repositories or running unreviewed dependency scripts with Claude Code. 3) Review and tighten permission settings so Edit and Bash actions require approval for unfamiliar projects. 4) Monitor for unexpected modifications to shell startup files (.zshrc, .zprofile), ~/.ssh/config, Git hooks and LaunchAgents, and for symlink swaps of directories inside workspaces. 5) Use endpoint detection to alert on rapid directory-to-symlink replacement patterns by processes spawned from Claude Code.
What systems are affected by CVE-2026-88968?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, AI coding assistants, developer workstations, sandboxed tool execution.
What is the CVSS score for CVE-2026-88968?
No CVSS score has been assigned yet.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0011.001Malicious PackageAML.T0053AI Agent Tool InvocationAML.T0105Escape to HostAML.T0112.000Local AI AgentCompliance Controls Affected
What are the technical details?
Original Advisory
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.
Exploitation Scenario
An attacker publishes a repository or npm dependency with a postinstall script. A developer on macOS opens it in Claude Code and the agent runs the script inside the Bash sandbox. The script loops, repeatedly replacing an in-workspace parent directory with a symlink pointing at the user's home directory while the agent performs an edit on a path inside that directory. When the swap lands after the Edit tool's validation, the unsandboxed Edit writes attacker-influenced content to a file such as ~/.zshrc, giving persistent code execution outside the sandbox.
Weaknesses (CWE)
CWE-367Time-of-check Time-of-use (TOCTOU) Race ConditionCWE-59Improper Link Resolution Before File AccessCWE-367 — Time-of-check Time-of-use (TOCTOU) Race Condition: The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.
- [Implementation] The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. This does not resolve the underlying issue of the execution of a function on a resource whose state and identity cannot be assured, but it does help to limit the false sense of security given by the check.
- [Implementation] When the file being altered is owned by the current user and group, set the effective gid and uid to that of the current user and group when executing this statement.
Source: MITRE CWE corpus.
References
- github.com/anthropics/claude-code/releases/tag/v2.1.251x_refsource_MISC
- github.com/anthropics/claude-code/security/advisories/GHSA-5xjx-9qx6-jcrvx_refsource_CONFIRM
Timeline
Related Vulnerabilities
CVE-2026-26119.6MLflow: cross-origin bypass enables RCE via AI agent
Same package: claude-codeCVE-2026-732228.8Claude Code Templates: unauth RCE via shell injection
Same package: claude-codeCVE-2026-75748.7Claude Desktop: VM integrity bypass enables RCE
Same package: claude-codeCVE-2026-350208.4Claude Code CLI: OS command injection via TERMINAL env
Same package: claude-codeCVE-2026-494718.3Serena: unauth dashboard API enables RCE via memory poisoning
Same package: claude-code