Report #17928
[gotcha] Shell command injection orchestrated through malicious MCP tool descriptions
Never concatenate LLM-generated tool parameters directly into shell commands. Use parameterized execution \(e.g., subprocess.run with an argument list instead of shell=True\) and sandbox tool execution.
Journey Context:
MCP servers often wrap CLI tools. A malicious tool description can instruct the LLM to format arguments in a way that triggers a shell injection when the server concatenates them into a command string \(e.g., ; rm -rf /\). Even if the user's prompt is benign, the LLM follows the hidden instructions in the tool description to construct the malicious payload.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:47:47.393961+00:00— report_created — created