CVE-2026-88968: Claude Code: TOCTOU Race in Edit Tool Allows File Writes Outside the Workspace

Published Nov 3, 2026
·
Updated

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.

Other sources

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.

— GitHub

Affected Software

2 affected componentsFixes available
Anthropic Claude Code<2.1.251
npm/@anthropic-ai/claude-code<2.1.251
2.1.251

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@anthropic-ai/claude-code to a version that resolves this vulnerability.

    Fixed in 2.1.251
  2. Upgrade

    Upgrade Claude Code to a version that resolves this vulnerability.

    Fixed in 2.1.251

Event History

Nov 3, 2026
CVE Published
via MITRE·08:08 PM
Data Sourced
via MITRE·08:08 PM
DescriptionWeakness
Data Sourced
via OSV·08:08 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:18 PM
DescriptionSeverityWeakness
Nov 9, 2026
Advisory Published
via GitHub·10:42 PM
Data Sourced
via GitHub·10:42 PM
DescriptionWeaknessAffected Software
Data Sourced
via OSV·10:42 PM
Affected Software

Frequently Asked Questions

1

Which environments are exposed to this issue?

The described exploit applies on macOS. It requires Claude Code versions prior to 2.1.251 and attacker-controlled code executing inside the Bash sandbox.

2

What must an attacker control to exploit the race condition?

An attacker needs code that runs in the Bash sandbox, such as code supplied through a malicious repository or dependency script. That code must atomically replace an in-workspace parent directory with a symlink after the Edit tool has validated the path.

3

What is the practical impact of successful exploitation?

Successful exploitation can cause the unsandboxed Edit implementation to overwrite a user-writable file outside the workspace. The vulnerability affects confidentiality, integrity, and availability according to the supplied severity vector.

4

What is the remediation?

Upgrade Claude Code to version 2.1.251, which fixes the issue. If upgrading is not immediately possible, avoid running untrusted repositories or dependency scripts that could execute attacker-controlled code in the Bash sandbox.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203