Fix mCP server declaration resolves code at run time in any host
An MCP server is launched with `npx -y`, `uvx`, `bunx`, or a container image with no digest, or is reached over a remote transport. The code that gets a tool call today is not necessarily the code that got one yesterday, and there is no version in the repository to review.
medium likely any host CWE-1357 / ASI ASI04
The vulnerable pattern in any host
This finding comes from the any host fixture in the owlwarden test suite. `any` resolves its package at run time with no version pinned, so today's code is whatever the registry serves. Whoever controls what that name resolves to controls a process holding tool access to this workspace.
The corrected configuration
Name an exact version or an image digest. The test is whether two developers cloning the repository on different days get the same server; `latest` fails it.
"args": ["-y", "mcp-db@1.4.2"]
If you are not using any host
Pin the version or the digest, and prefer a dependency in `devDependencies` over a run-time resolve. For a remote transport, state the trust decision in the config - a comment naming who runs the endpoint - rather than leaving it implicit.
Check your own repository
npx owlwarden scan
npx owlwarden explain agent-mcp-unpinned-remote
Runs on your machine. No account, no telemetry, no network unless you ask. In CI, SARIF uploads to code scanning and the exit code is the gate.
Other any host checks
Rules with a tested any host example.
- agent-config-secret-reachable high Repository config puts credentials in reach of a repository-controlled command
- agent-instructions-directive medium Instruction file tells the agent to bypass its own controls
agent-mcp-unpinned-remote for every agent host / All rules / owlwarden