Report #14873
[gotcha] Shell Command Injection via Tool Routing
Never use string interpolation to build shell commands from tool names or arguments. Use structured execution environments \(like containers or strict argument arrays\) instead of subprocess.run with shell=True.
Journey Context:
Some MCP server implementations dynamically route tool calls to bash scripts based on the tool name. If an attacker can register a tool or manipulate the name/args, they can achieve RCE on the MCP server host. It's the classic shell injection, but reborn in the MCP tool routing layer, where developers assume the LLM only outputs safe strings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:40:23.045087+00:00— report_created — created