# GHSA-5XJX-9QX6-JCRV: Claude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace

- Database: GitHub
- Severity: high (stated by ghsa, no CVSS score)
- Published: 2026-11-09
- Modified: 2026-11-09

## Tracked as

- [CVE-2026-88968](https://cve.now/CVE-2026-88968.md): Claude Code file write outside workspace via race in Edit tool

## Affected versions

- @anthropic-ai/claude-code (npm): fixed in 2.1.251

## 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

- https://github.com/anthropics/claude-code/security/advisories/GHSA-5xjx-9qx6-jcrv
- https://nvd.nist.gov/vuln/detail/CVE-2026-88968
- https://github.com/anthropics/claude-code
- https://github.com/anthropics/claude-code/releases/tag/v2.1.251

Page: https://cve.now/GHSA-5XJX-9QX6-JCRV

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
