[Bug] Insufficient validation of bash tool arguments allows unsafe wildcard expansion

Resolved 💬 3 comments Opened Nov 18, 2025 by jaodsilv Closed Nov 22, 2025

Bug Description
Claude code run Bash(rm:*) without permission. Potentially losing non-commited and non-pushed changes
The issue was due to a sum of mistakes.

  1. I had worktrees with multiple formats on D:/src/worktrees/{repo}/{branch}, D:/src/{repo}-{branch}, and others relative paths, like ../worktrees/{repo}/{branch}
  2. It was getting confusing, so I decided to restructure and unify everything to D:/src/{repo}/{branch}
  3. Some relative paths were mistakenly renamed from ../worktrees/{repo-old-name}/{branch} to D:/src/{repo-current-name}/worktrees/{repo-old-name}/{branch} directly to the .git folder files, not actually moving any file
  4. I asked to move worktrees and Claude Code failed to find these paths, so I requested to look into D:/src/worktrees
  5. Unluckyly .git file on those worktrees were broken, so, Instead of fixing the paths and run git worktree fix, and then moving the worktrees, it removed the broken .git, pulled new worktrees for those branches in the correct new path and removed the older paths entirely.

The actual issue: These removals were performed without consent from my side and outside of the original plan.

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.0.37
  • Feedback ID: 700a454c-1e74-4a9f-8d0c-0c0e43651c06

Errors

[{"error":"Error\n    at NK (B:/~BUN/root/claude.exe:59:1142)\n    at <anonymous> (B:/~BUN/root/claude.exe:64:10074)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at spawnSync (unknown)\n    at spawnSync (node:child_process:226:22)\n    at cVH (B:/~BUN/root/claude.exe:94:1304)\n    at VV (B:/~BUN/root/claude.exe:94:3610)\n    at ynH (B:/~BUN/root/claude.exe:1611:1339)\n    at request (B:/~BUN/root/claude.exe:66:2146)\n    at processTicksAndRejections (native:7:39)\n    at spawnSync (unknown)\n    at spawnSync (node:child_process:226:22)\n    at cVH (B:/~BUN/root/claude.exe:94:1304)\n    at VV (B:/~BUN/root/claude.exe:94:3610)\n    at ynH (B:/~BUN/root/claude.exe:1611:1339)\n    at isRelevant (B:/~BUN/root/claude.exe:2288:10869)\n    at isRelevant (B:/~BUN/root/claude.exe:2288:10881)\n    at <anonymous> (B:/~BUN/root/claude.exe:2288:13588)","timestamp":"2025-11-14T19:43:02.291Z"},{"error":"Error: Invalid JSON syntax in settings file at D:\\src\\.claude\\settings.local.json\n    at AD (B:/~BUN/root/claude.exe:3758:39596)\n    at PzH (B:/~BUN/root/claude.exe:87:18954)\n    at ny (B:/~BUN/root/claude.exe:3758:14807)\n    at ef$ (B:/~BUN/root/claude.exe:3758:16130)\n    at onAllow (B:/~BUN/root/claude.exe:2275:5512)\n    at onAllow (B:/~BUN/root/claude.exe:2275:6043)\n    at C (B:/~BUN/root/claude.exe:1999:3710)\n    at <anonymous> (B:/~BUN/root/claude.exe:1976:5900)\n    at <anonymous> (B:/~BUN/root/claude.exe:218:497)\n    at <anonymous> (B:/~BUN/root/claude.exe:103:51074)","timestamp":"2025-11-18T18:49:36.542Z"},{"error":"Error: Invalid JSON syntax in settings file at D:\\src\\.claude\\settings.local.json\n    at AD (B:/~BUN/root/claude.exe:3758:39596)\n    at PzH (B:/~BUN/root/claude.exe:87:18954)\n    at ny (B:/~BUN/root/claude.exe:3758:14807)\n    at ef$ (B:/~BUN/root/claude.exe:3758:16130)\n    at onAllow (B:/~BUN/root/claude.exe:2275:5512)\n    at onAllow (B:/~BUN/root/claude.exe:2275:6043)\n    at C (B:/~BUN/root/claude.exe:1999:3710)\n    at <anonymous> (B:/~BUN/root/claude.exe:1976:5900)\n    at <anonymous> (B:/~BUN/root/claude.exe:218:497)\n    at <anonymous> (B:/~BUN/root/claude.exe:103:51074)","timestamp":"2025-11-18T19:01:03.908Z"}]

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗