Report #12832
[gotcha] Maliciously crafted tool names or parameter names trick the LLM into generating malformed JSON or shell commands
Strictly validate and sanitize tool names and inputSchema properties on the client/host side before presenting them to the LLM; reject tools with non-alphanumeric characters.
Journey Context:
LLMs construct JSON payloads based on the schema. If a parameter is named '; rm -rf /; ', or a tool name contains escape characters, the LLM might generate output that breaks the host's parsing logic or, if the host passes it to a shell, causes injection. Treating the MCP schema as trusted code is a mistake.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:10:00.712079+00:00— report_created — created