medium
MCP server that can run shell commands
The server's name or package suggests it executes commands on your machine.
Why it matters
A prompt injection in any document, issue or web page the agent reads could run commands with your access.
How to fix it
Run it in a sandbox or container, require approval for every command, and keep it away from agents that read untrusted content. The checker keeps flagging it after you do this, because it can still run commands; that's intended.
Before
{
"mcpServers": {
"shell": {
"command": "npx",
"args": [
"[email protected]"
],
"autoApprove": [
"run_command"
]
}
}
}After
{
"mcpServers": {
"shell": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--network",
"none",
"-v",
"/home/alex/sandbox:/work",
"some/shell-mcp:1.0.0"
]
}
}
}Illustrative configs. The checker flags both versions with this finding on purpose: the “after” server can still run commands, it's just contained.
Other checks
- Secret written into an MCP config
- Secret passed as a command-line argument
- Secret inside an MCP server URL
- Remote MCP server over unencrypted http
- Remote MCP server with no credentials configured
- Unpinned MCP server package or image
- MCP server installs without asking (npx -y)
- MCP server container runs --privileged
- MCP server container shares the host network
- Broad host folder or Docker socket mounted into an MCP container
- MCP filesystem server with access to a very broad path
- MCP server launched through a shell
- MCP tools auto-approved or always allowed