Report #74580
[gotcha] LLM passes unsanitized string parameters to shell-executing MCP tools
MCP tools must use parameterized execution \(e.g., arrays of arguments\) instead of string concatenation for shell commands. Never use \`shell=True\` or equivalent.
Journey Context:
When an LLM calls a tool like \`run\_command\(command="ls -la"\)\`, developers often concatenate strings and pass to a shell. The LLM can be tricked via prompt injection into sending \`command="rm -rf / ; ls -la"\`. Using parameterized execution \(like \`subprocess.run\(\["ls", "-la"\]\)\`\) prevents the shell from interpreting the injection, treating the entire injected string as a single argument or filename.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:46:55.608841+00:00— report_created — created