Report #71324
[gotcha] MCP server command injection via LLM arguments
Use parameterized execution \(e.g., subprocess.run with an array\) instead of string interpolation \(os.system\) for any tool that executes shell commands based on LLM-provided arguments.
Journey Context:
The LLM is effectively an adversary if subjected to indirect prompt injection. If a tool naively concatenates LLM output into a shell command, an injected prompt can force the LLM to send malicious shell payloads \(e.g., ; rm -rf /\). Parameterized execution prevents shell interpretation of metacharacters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:17:38.132873+00:00— report_created — created