Sonirico mcp-shell
mcp-shell: Secure Mode Allowlist Bypass via Default `/bin/bash` Executable
mcp-shell is an MCP server for running shell commands securely, auditably, and on demand. Prior to 0.6.0, the default Docker security.yaml includes /bin/bash in allowed_executables, while security.go validates only the first token and checkBlockedPatternsAndCommands does not reject the shell command-mode flag -c. A caller of the shell_exec MCP tool can provide the command argument `/bin/bash -c <arbitrary-command>`, which passes validation and reaches executor.go, where parseCommand and exec.CommandContext execute the arbitrary command as mcpuser outside the intended allowlist. This issue is fixed in version 0.6.0.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 0.6.0
Fixed in 0.6.0
Mitigation
Upgrade mcp-shell to 0.6.0 or later.
References
- Vendor advisory github.com/sonirico/mcp-shell/security/advisor…
- Patch github.com/sonirico/mcp-shell/pull/16
- Patch github.com/sonirico/mcp-shell/commit/f31377fce…
1 more
- Release notes github.com/sonirico/mcp-shell/releases/tag/v0.…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.