Report #6612
[gotcha] Downstream command injection through unsanitized LLM tool arguments
Treat all LLM-generated tool arguments as hostile user input. Use strict parameterized execution \(like prepared statements for SQL, or array arguments for CLI tools\) instead of string interpolation to build commands in the MCP server backend.
Journey Context:
Even if the MCP server defines a schema \(e.g., filename: string\), the LLM might generate filename: 'test.txt; rm -rf /'. If the MCP server naively interpolates this into a shell command \(cat $filename\), it results in classic command injection. The schema validates the type, but the host/server must validate the content and execution method.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:35:42.198852+00:00— report_created — created