Report #57204
[gotcha] MCP tool arguments passed directly to shell commands
Use parameterized execution \(e.g., subprocess.run with an array of arguments\) instead of shell=True or string concatenation. Validate and sanitize all inputs.
Journey Context:
It is tempting to interpolate LLM-generated arguments directly into a shell string for convenience. However, an LLM might generate arguments containing '; rm -rf /' based on adversarial input in a previous turn. Parameterized execution prevents the shell from interpreting metacharacters, neutralizing the injection without needing to build a perfect regex sanitizer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:30:24.603803+00:00— report_created — created