CVE-2026-88968

Claude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace

Published Nov 3, 2026 CVSS 4.0 · 7.7 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

Claude Code’s Edit tool suffered a time‑of‑check to time‑of‑use race condition whereby the target path was validated using pathname and symlink resolution that was not tied to the underlying directory inode or file descriptor. An attacker who can run code within the sandbox can atomically replace a normal parent directory inside the workspace with a symlink after validation. The unsandboxed Edit implementation then performs the file write and overwrites a file outside the workspace scope. The flaw maps to TFTOC and path‑traversal weaknesses (CWE‑367 and CWE‑59) and can result in arbitrary file modification, potentially enabling privilege escalation or remote code execution if critical files are overwritten.

Affected Systems

All releases of the Claude Code agent before version 2.1.251 are affected. The issue has been fixed in the 2.1.251 release and later. The product vendor is Anthropics, offering the Claude Code coding tool via the anthropics:claude-code series.

Risk and Exploitability

The vulnerability carries a CVSS score of 7.7 and no EPSS score is available. The issue is not listed in the CISA KEV catalog. Exploitation requires attacker‑controlled code already executing inside the sandbox, such as malicious repository content or a dependency script, after which the race can be triggered to target an arbitrary external file. While the attack is confined to sandboxed environments, the resulting outside‑workspace writes can lead to serious compromise if overwritten files are critical.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the official patch by upgrading Claude Code to version 2.1.251 or later.
  • Restrict execution of untrusted code within the sandbox by limiting repository and dependency script privileges.
  • Enforce filesystem permissions or sandbox configurations that deny write access to directories outside the workspace.

Generated by OpenCVE AI on November 3, 2026 at 23:58 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-5xjx-9qx6-jcrv Claude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Anthropics
Anthropics claude Code
Vendors & Products Anthropics
Anthropics claude Code
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.7, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H'}

threat_severity

Important

Type Values Removed Values Added
Description 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.
Title Claude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace
Weaknesses CWE-367
CWE-59
References
Metrics cvssV4_0

{'score': 7.7, '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'}

Weaknesses
  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition

  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 3, 2026, 9:29 PM
Reserved
Sep 10, 2026, 4:02 PM
Status
Awaiting Analysis
Published
Nov 3, 2026, 8:18 PM
Modified
Nov 3, 2026, 10:19 PM
Severity
Important
Public date
Nov 3, 2026, 8:08 PM