STUPID-2026-0130
Claude Code's "dangerous rm" safety check is spelling-dependent — the MSYS form of a Windows path bypasses the approval gate entirely (GitHub #100630)
Why 7/10
The dangerous-rm approval gate can be bypassed by path spelling. Shown in a controlled test, with no real loss.
- Scope
- 3/4
- A whole machine or drive, an organisation's production system or data, or many credentials
- Recoverability
- 3/3
- Permanently lost or irreversible, including data that was exposed
- Did it happen
- 1/2
- Demonstrated (proof of concept, reproduction, controlled test or near-miss) with no real victim reported
- Beyond the user
- 0/1
- Only the user's own non-production work
The score is the sum of these four factors. How each factor is scored · scored 2026-10-29
Instruction given
N/A — this is a flaw in Claude Code's own built-in destructive-command check, not a task given to the agent by a user. The reporter deliberately probed the safety gate rather than describing a real user session, and withheld the exact reproduction command to avoid handing out a working bypass.
Expected behavior
Two spellings of the same on-disk location should be treated identically by the "dangerous rm" check. Git Bash / MSYS on Windows treats `/d/<path>` and `D:\<path>` as the same location, so a recursive delete targeting a top-level directory should raise the approval gate under either spelling.
Actual behavior
The check's drive-letter detection only matches a single-segment Windows-form path (`D:\<top>`), which it held for approval with the message "Dangerous rm operation detected: 'D:/hql-gateprobe'". In the same session, the MSYS-form spelling of top-level directories (`/d/<top>`) ran to completion with no prompt at all (`rc=0`), and the reporter confirms the targeted directories were removed. The underlying regex never canonicalizes the MSYS path form to a drive letter before the check runs, so it is simply never evaluated for that spelling.
Damage
The reporter ran this as a controlled test against disposable target directories, not as an accidental real-world deletion, and the issue names no victim or dataset lost. The significance is the bypass itself: on any Windows machine running Claude Code through Git Bash / MSYS, a recursive delete that would otherwise require explicit approval runs unprompted whenever the target path is written in its MSYS form rather than its Windows form — a gate meant to be unconditional is conditional on path spelling. The reporter links two unrelated prior Windows `rm -rf` reports (#99193, #36339) to distinguish this from previously known bugs. Labeled `area:sandbox`, `area:security`, `bug`, `has repro`, `platform:windows`; open with no maintainer response at time of writing.
Full write-up
On October 8, 2026, Claude Code user RayOdyssey filed anthropics/claude-code issue #100630 after finding that the editor's built-in "dangerous rm" safety check — the prompt that is supposed to stop a recursive delete from running without explicit approval — can be bypassed just by spelling the target path differently. Testing on Windows 11 with Claude Code 2.1.293 through Git Bash (MSYS/MINGW64), the reporter pointed a delete at a top-level directory using the Windows-form path D:\hql-gateprobe and got the expected gate: "Dangerous rm operation detected: 'D:/hql-gateprobe'", held for approval. Pointing the same class of delete at a top-level directory using the MSYS-form spelling (/d/<top>) — which Git Bash treats as exactly the same location — produced no prompt whatsoever. The command ran to completion and the reporter confirms the targeted directories were gone.
The reporter traced the cause into the bundled check itself: its drive-letter pattern only matches the single-segment Windows form of a path, so the MSYS spelling is never canonicalized to a drive letter before the test runs, and is therefore invisible to it. Because this is a path-formatting gap rather than a one-off destructive command, it affects any top-level delete issued through Git Bash in its MSYS form, not a specific script or task. The reporter deliberately did not publish the exact command used, warning that doing so would hand out a working bypass of the gate, and proposed a fix: normalize MSYS-style paths (/[a-z]/...) to their drive-letter equivalent at the path-canonicalization layer, before the dangerous-rm test runs rather than after. The issue is labeled area:sandbox, area:security, bug, has repro, and platform:windows, and had received no maintainer response at time of writing.
Classification
- Agent
- Claude Code
- Failure mode
- Security Vulnerability
- Root cause
- Other
- Domain
- Security
- Language
- Bash
- OWASP Agentic Top 10 (our mapping)
- ASI02 Tool Misuse and Exploitation list
- MIT AI Risk Repository (our mapping)
- 7.3 Lack of capability or robustness · 2.2 AI system security vulnerabilities and attacks taxonomy
- Source
- Github Issue
Related incidents
Cite this record
StupidLLM. "STUPID-2026-0130: Claude Code's "dangerous rm" safety check is spelling-dependent — the MSYS form of a Windows path bypasses the approval gate entirely (GitHub #100630)." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0130/ (accessed 2026-11-23). CC BY 4.0.
← STUPID-2026-0129By IDSTUPID-2026-0131 →
Get told when an agent breaks something
We document AI agent failures daily, severity-scored against a published scale. Each Monday, if any scored 7 or above that week — deleted data, leaked secrets, broken production — you get one email with the sources. When nothing did, you get nothing.
This database is callable over MCP — query it from inside your agent.