Skip to main content
← Vulnerabilities

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

Claude Code versions before 2.1.251 on macOS are affected when attacker-controlled code runs inside the Bash sandbox. The fix is in 2.1.251.

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

7.7HighCNA
Exploited
No known exploitation
Fix
Fixed in 2.1.251
Who is exposed
Specific setups only

Do first: Check whether your setup matches what the bug needs. Claude Code versions before 2.1.251, where the Edit tool validated targets using point-in-time pathname and symlink resolution Running on macOS Attacker-controlled code must run inside the Bash sandbox, e.g. from a malicious repository or dependency script

21Pcve.now Index 21 of 100 · methodology v3 · provisional
  • Exploitation0/40No signal
  • Exposure12/25Specific setups only, reachable over the network without a login
  • Reach?/20Reach: unknown (data gap). No tracked technology or package matched
  • Severity8.7/10CVSS 7.7, total technical impact per CISA
  • No patch0/5No signal

What would change the score

  • Would score about 71 if added to CISA KEV
  • Would score about 66 if CISA's SSVC rates exploitation active

CVE-2026-88968 is not in CISA's Known Exploited Vulnerabilities (KEV) catalog. No public exploit code is tracked. It is rated CVSS 7.7 (high) and affects claude-code; fixed in 2.1.251.

Published
Last modified
Published
Not listed in CISA KEV
21/100 · provisional
Specific setups only
Fix
Fixed in 2.1.251
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: none
  • Automatable: no
  • Technical impact: total

Summary

Claude Code, the agentic coding tool, is affected on macOS before the fixed release. An attacker who can run code inside the Bash sandbox, such as through a malicious repository or dependency script, could trick the Edit tool into overwriting a user-writable file outside the project workspace.

Read the original 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.

What to do

  • Check whether your setup matches what the bug needs.

    Claude Code versions before 2.1.251, where the Edit tool validated targets using point-in-time pathname and symlink resolution Running on macOS Attacker-controlled code must run inside the Bash sandbox, e.g. from a malicious repository or dependency script
  • Upgrade to a fixed version: 2.1.251.

Timeline

  1. CVE published
  2. First seen by cve.now
  3. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: total

  4. Record last updated

Affected versions

  • anthropics claude-code

    fixed in 2.1.251

Evidence 2

  1. Advisory
  2. Repository

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

FAQ

Questions about CVE-2026-88968

Is CVE-2026-88968 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data

What does this mean?

The Edit tool checked its target paths only at one point in time, using pathname and symlink resolution. A process inside the Bash sandbox could change what a path points to after that check, so the unsandboxed Edit implementation could overwrite a user-writable file outside the workspace.Source: github.com

Which versions are affected by CVE-2026-88968?

claude-code: before 2.1.251.Source: cve.now feed data

Am I affected, and how do I check?

Claude Code versions before 2.1.251 running on macOS. The bug also requires attacker-controlled code to run inside the Bash sandbox, such as from a malicious repository or dependency script. To check, compare the installed Claude Code version against 2.1.251 and confirm the operating system is macOS.Source: github.com

How do I fix CVE-2026-88968?

Upgrade Claude Code to version 2.1.251 or later, which contains the fix.Source: github.com