Time-of-check Time-of-use (TOCTOU) Race Condition Affecting @anthropic-ai/claude-code package, versions <2.1.251


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.38% (35th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-ANTHROPICAICLAUDECODE-23050793
  • published30 Nov 2026
  • disclosed9 Nov 2026
  • creditSunder Singh

Introduced: 9 Nov 2026

NewCVE-2026-88968  (opens in a new tab)
CWE-367  (opens in a new tab)
CWE-59  (opens in a new tab)

How to fix?

Upgrade @anthropic-ai/claude-code to version 2.1.251 or higher.

Overview

@anthropic-ai/claude-code is an Use Claude, Anthropic's AI assistant, right from your terminal. Claude can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.

Affected versions of this package are vulnerable to Time-of-check Time-of-use (TOCTOU) Race Condition via a TOCTOU race condition in the Edit tool, which validates target paths using point-in-time pathname and symlink resolution that is not bound to the underlying directory inodes or file descriptors. A process running inside Claude Code's Bash sandbox can exploit the resulting check-to-use window by atomically swapping an in-workspace parent directory with a symlink after validation completes, causing the unsandboxed Edit implementation to overwrite an attacker-selected user-writable file outside the workspace. This vulnerability is only exploitable on macOS and requires the ability to execute attacker-controlled code inside the sandbox, such as through a malicious repository or dependency script.

CVSS Base Scores

version 4.0
version 3.1