Claude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace
- State
- Published
- Severity
- 7.7 High
- Published
- Nov 3, 2026
- Updated
- Nov 3, 2026
- Reserved
- Sep 10, 2026
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.
| Product | Versions |
|---|---|
| claude-code anthropics | < 2.1.251 Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 4.0 | 7.7 High | GitHub_M |
Weaknesses
References
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.