Report #97367
[gotcha] Command injection when MCP tool input reaches shell, SQL, or filesystem
Build tools as parameterized APIs with strict JSON schema validation and allow-lists for paths, IDs, and enum values. Never concatenate tool arguments into shell commands, SQL, or file paths. Run execution inside a sandbox with least privilege and no network egress by default.
Journey Context:
Many MCP servers wrap shell commands or database queries. The model constructs arguments from untrusted user context and poisoned tool descriptions. The injection primitives are familiar, but the attacker can chain them through prompt injection and multi-tool workflows, so parameterization is non-negotiable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:59:54.587727+00:00— report_created — created