CVE-2026-88968: Claude Code before 2.1.251 on macOS let code in the Bash sandbox trick the Edit tool into overwriting files outside the workspace
Claude Code's Edit tool checked its target path with a one-time pathname and symlink resolution that was not tied to the real directory. On macOS, code running inside Claude Code's Bash sandbox, for example from a malicious repository or dependency script, could swap a workspace folder for a symlink right after the check, so the unsandboxed Edit tool overwrote a user-writable file outside the workspace. Fixed in 2.1.251.
What it is
The Edit tool validated targets using point-in-time path and symlink resolution that was not bound to directory inodes or file descriptors, leaving a time-of-check to time-of-use window.
On macOS, a process inside the Bash sandbox could atomically replace an in-workspace parent directory with a symlink after validation, and the Edit implementation, which runs outside the sandbox, then wrote to an attacker-chosen file outside the workspace.
Exploitation needs attacker-controlled code running in the sandbox, such as a malicious repository or a dependency's install or build script, which is exactly what the sandbox is meant to contain.
Anthropic says users on standard auto-update already received the fix; manual updaters need to update.
How to check
- Run claude --version; anything before 2.1.251 is affected.
- The risk is highest if you use Claude Code on macOS in repositories or with dependencies you don't fully trust.
How to fix
- Update Claude Code to 2.1.251 or later (auto-update does this; with npm, install the latest @anthropic-ai/claude-code).
- Until then, don't run Claude Code in untrusted repositories.
claude --version
npm install -g @anthropic-ai/claude-code@latest Sources
- criticalMalicious npm packages posing as AI agent tools: agentic-awesome-skills, x402-prompt-injection-scan and formatting-subtitles-for-claude
- criticalLiteLLM 1.107.0 on PyPI and Docker was malware: a credential stealer that runs whenever Python starts
- criticalMalicious npm packages posing as ChatGPT, Claude and Codex setup tools
- criticalCVE-2026-96620: Claude Agent SDK (Python) resume option lets attackers run commands