[Bug] Security Config: Bash Destructive Commands Not Properly Restricted

Resolved 💬 2 comments Opened Sep 12, 2025 by dddraxxx Closed Sep 12, 2025

Bug Description
report this problem: we use "ask": ["Bash(rm:)", "Bash(rm -rf:)"] bin settings but it still allow it everytime (we allow bash config)

Environment Info

  • Platform: linux
  • Terminal: vscode
  • Version: 1.0.112
  • Feedback ID: 2843bc40-8cee-4861-a53e-fab6f18c9c73

Errors

[{"error":"RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded\n    at Socket.onChildStdout (node:child_process:484:14)\n    at Socket.emit (node:events:508:28)\n    at Socket.emit (node:domain:489:12)\n    at addChunk (node:internal/streams/readable:559:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)\n    at Readable.push (node:internal/streams/readable:390:5)\n    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)","timestamp":"2025-09-12T05:20:32.639Z"},{"error":"Error: String not found in file. Failed to apply edit.\n    at PS (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1836:728)\n    at jC0 (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1836:104)\n    at Object.renderToolUseRejectedMessage (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1893:1608)\n    at hzB (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3020:1722)\n    at rD (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:84:19415)\n    at vl (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:42814)\n    at V9 (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38355)\n    at cf (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38283)\n    at WC (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38137)\n    at GH (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:35216)","timestamp":"2025-09-12T05:20:32.877Z"},{"error":"Error: String not found in file. Failed to apply edit.\n    at PS (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1836:728)\n    at jC0 (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1836:104)\n    at Object.renderToolUseRejectedMessage (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1893:1608)\n    at hzB (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3020:1722)\n    at rD (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:84:19415)\n    at vl (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:42814)\n    at V9 (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38355)\n    at cf (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38283)\n    at WC (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38137)\n    at GH (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:35216)","timestamp":"2025-09-12T05:20:32.883Z"},{"error":"Error: String not found in file. Failed to apply edit.\n    at PS (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1836:728)\n    at jC0 (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1836:104)\n    at Object.renderToolUseRejectedMessage (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1893:1608)\n    at hzB (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:3020:1722)\n    at rD (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:84:19415)\n    at vl (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:42814)\n    at V9 (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38355)\n    at cf (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38283)\n    at WC (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38137)\n    at GH (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:35216)","timestamp":"2025-09-12T05:20:32.892Z"},{"error":"Error: Invalid settings\n    at UU9 (file:///home/kuoyang/.nvm/versions/node/v24.7.0/lib/node_modules/@anthropic-ai/claude-code/

Note: Error logs were truncated.

settings.json:

{
  "model": "opus",
  "permissions": {
    "allow": [
      "Bash",
      "Read",
      "Write",
      "Edit",
      "MultiEdit",
      "Glob",
      "Grep",
      "Task",
      "TodoWrite",
      "WebFetch",
      "WebSearch",
      "ExitPlanMode",
      "NotebookEdit",
      "BashOutput",
      "KillBash"
    ],
    "ask": ["Bash(rm:*)", "Bash(rm -rf:*)"]
  },
  "env": {
    "CLAUDE_BASH_TIMEOUT": "1800000"
  }
}

View original on GitHub ↗

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