HIGH · CVSS 4.0 EPSS 0.5% · 32th percentile CWE-367CWE-59

CVE-2026-88968: Claude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace

Published 2026-11-09 · Updated 2026-11-09 · Also known as GHSA-5xjx-9qx6-jcrv

Summary

Claude Code contains a TOCTOU race condition in the Edit tool that allows unauthorized file writes outside the intended workspace via symlink manipulation. Users of versions prior to 2.1.251 should update immediately to remediate the vulnerability.

Who is affected

This vulnerability affects deployments of @anthropic-ai/claude-code on macOS where an attacker can execute code within the Bash sandbox. By exploiting a time-of-check to time-of-use window during directory validation, an attacker can overwrite arbitrary user-writable files outside the sandbox boundaries.

Exploitability

The vulnerability is rated as High severity, requiring low attack complexity but physical or social engineering-adjacent preconditions to achieve code execution. It currently has a low EPSS score of 0.003 and is not listed in CISA's Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
npm @anthropic-ai/claude-code >= 0, < 2.1.251 2.1.251 npm install @anthropic-ai/[email protected]

CVSS 4.0 vector

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

Attack vectorNetwork
Attack complexityLow
Attack requirementsPresent
Privileges requiredNone
User interactionPassive
Confidentiality (vulnerable system)High
Integrity (vulnerable system)High
Availability (vulnerable system)High
Confidentiality (subsequent systems)None
Integrity (subsequent systems)None
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

What is the root cause of this vulnerability?

The flaw is caused by a Time-of-Check to Time-of-Use (TOCTOU) race condition in the Edit tool, where pathname validation is not bound to directory inodes or file descriptors.

Is this vulnerability actively being exploited?

There is no evidence of active exploitation, and the vulnerability is not listed on the CISA Known Exploited Vulnerabilities catalog.

How can an attacker exploit this?

An attacker needs the ability to execute code within the Claude Code Bash sandbox, such as through a malicious repository or a compromised dependency script, to perform the atomic directory swapping required.

Original advisory description
Claude Code validated Edit tool targets using point-in-time pathname and symlink resolution that was not bound to the underlying directory inodes or file descriptors. On macOS, a process running inside Claude Code's Bash sandbox could exploit the resulting time-of-check to time-of-use window by atomically swapping an in-workspace parent directory with a symlink after validation completed, causing the unsandboxed Edit implementation to overwrite an attacker-selected user-writable file outside the workspace. Exploiting this required the ability to run attacker-controlled code inside the sandbox, such as through a malicious repository or dependency script. Users on standard Claude Code auto-update have received this fix automatically. Users performing manual updates are advised to update to the latest version. Claude Code thanks hackerone.com/mahoraga007 (Sunder Singh) for reporting this issue.

References

Source records: GHSA-5xjx-9qx6-jcrv (OSV.dev) · EPSS by FIRST, 2026-11-27.