Best practiceMCP servers and tools
Treat MCP server configuration as code execution
OWASP ASI05OWASP ASI04
A STDIO MCP server is started by running the command in its configuration. Whoever can write that configuration (a user of your web UI, an API caller, a prompt-injected agent) can run commands on the host. This produced a wave of CVEs in LiteLLM, Flowise, Langflow, Windsurf and others in 2026.
What to do
- Never let untrusted users or agents add or edit MCP server definitions; treat the config file like a deployment manifest.
- In products, allow-list exact binaries with no argument pass-through (npx and npm are shells), or launch servers only in a sandbox.
- Bind local HTTP MCP servers to localhost, validate the Host header and use the SDK versions with DNS rebinding protection on.
- Require approval and show the full command whenever an agent proposes a config change.