Case · DiggingBeagle record

Claude Code Edit could write outside the workspace through a macOS symlink race

A sandboxed shell process could race the unsandboxed Edit tool pathname check and redirect a validated write outside the workspace.

Public disclosure: Oct 26, 2026

Scope

The agent has access to the Bash sandbox and the Edit operation; a local adversarial process can atomically change a directory symlink. The post-validation rename caused a file edit to resolve through the new symlink outside the path that had passed the workspace check.

Assessment profile

Assessment method
Setting
research demonstration
Exploitation
demonstrated
Evidence
Grade B
Remediation
patch available
AI role
AGAINST AI
Basis and provenance

Scoped Claim(s) link to SRC-2026-DB233-CLAUDE-EDIT-TOCTOU; reviewed as vulnerability in research_demonstration. Only reported controlled behavior or proof-of-concept is established; no production victim or impact magnitude is measured.

Assessed Nov 10, 2026 using diggingbeagle.assessment/1.

At a glance

Mechanism and trust boundary

  1. 01

    Precondition and trust context

    The agent has access to the Bash sandbox and the Edit operation; a local adversarial process can atomically change a directory symlink.

  2. 02

    Crossed boundary

    The post-validation rename caused a file edit to resolve through the new symlink outside the path that had passed the workspace check.

  3. 03

    Observed limit

    Requires macOS timing and writable target; not evidence of unrestricted host-wide permission or observed production compromise.

Timeline

  1. Oct 26, 2026
    Event type unspecified

    Initial documented finding

    Claude Code Edit could write outside the workspace through a macOS symlink race

  2. Oct 26, 2026
    disclosure

    Public disclosure

Claims & evidence

CLM-DB233-CLAUDE-EDIT-TOCTOU-01The advisory reports a time-of-check/time-of-use gap in Edit target validation and inode binding on macOS.supported

Basis: reported finding

Link to claim
CLM-DB233-CLAUDE-EDIT-TOCTOU-02The affected package is @anthropic-ai/claude-code below 2.1.251; the patch is 2.1.251.supported

Basis: reported finding

Link to claim

Controls and mitigations

  • Use the patched Claude Code version and bind edit targets to stable file descriptors or inode-checked directories across validation and write.
  • Do not run untrusted repository scripts with write access to outside-workspace locations while an agent is editing files.

Unknowns and contradictions

  • Requires macOS timing and writable target; not evidence of unrestricted host-wide permission or observed production compromise.

Sources and citation

Material revision history

  1. Nov 10, 2026 · Published version · first publication · revision 235