Skip to main content

SKY-D367 · Supply chain and agent configuration

MCP server launched without an exact version

Medium

An MCP server entry tells a coding agent which program to start, such as npx -y @modelcontextprotocol/server-github. Without an exact version, npx, uvx or docker run fetch whatever the registry serves at that moment. SKY-D367 reports committed MCP servers that are fetched this way.

Languages
MCP configuration files
Quality gate
Full scan: listed, not counted by the gate. Diff scan: counted toward the gate limits. A baseline scan counts it like a diff scan when the baseline's rule_coverage lists it.
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

If the package's publisher account is taken over, the next release runs inside every developer's agent session with the tokens in its env. The postmark-mcp package shipped fifteen clean versions before one started copying every email it sent to an attacker.

What Skylos flags

.mcp.json · JSONReported on line 3
{  "mcpServers": {    "github": {      "command": "npx",      "args": ["-y", "@modelcontextprotocol/server-github"],      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" }    }  }}

What Skylos leaves alone

.mcp.json · JSON
{  "mcpServers": {    "github": {      "command": "npx",      "args": ["-y", "@modelcontextprotocol/server-github@2025.4.8"],      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" }    },    "time": { "command": "uvx", "args": ["mcp-server-time==0.6.2"] },    "docs": { "type": "http", "url": "https://mcp.example.com/mcp" }  }}

Why Skylos leaves it alone

Both launched servers name an exact version, so each start fetches the same release. The docs server is a remote URL: there is no local command to fetch, so this rule does not look at it.

How Skylos decides

  1. Runs with --danger (and -a). The ca9 library reads the mcpServers or servers block of .mcp.json, .cursor/mcp.json, .vscode/mcp.json, .kiro/settings/mcp.json, and the mcp.json of .roo, .amazonq and .windsurf; the same blocks in .claude/settings.json, .claude/settings.local.json and .gemini/settings.json; the mcp block of .vscode/settings.json; and [mcp_servers.*] in .codex/config.toml. Dependency folders such as node_modules are skipped.
  2. Builds the launch from command plus args. A server with only a url is not checked. It looks through cmd /c, sh -c and env wrappers to the launcher: npx, pnpx, bunx, npm exec, pnpm dlx, yarn dlx, bun x, uvx, uv tool run, pipx run, docker run, podman run or deno run.
  3. Reports the server when its launcher fetches the package and the version is not exact. Exact means pkg@1.2.3 for npm, pkg==1.2.3 or pkg@1.2.3 for PyPI, a full 40-character Git commit, or an image digest (@sha256:…). @latest, ranges and image tags such as :1.4.0 are not exact. Local scripts, node server.js and python -m do not fetch and are not reported.
  4. Reports on the line of the server's name. Keeps the same files as SKY-D365 (regular files in the scanned folder that Git lists, or every file outside Git).
  5. In the gate, a full scan lists the finding without counting it; a diff scan counts a new one under the security limits. A finding is new when its rule, file and a digest of the server name and command are not among the merge base's findings.

How to fix it

Pin an exact, reviewed version and update it on purpose, the way you update a dependency. For Docker, pin the image digest.

.mcp.json · JSON · the fix, against the flagged file
{  "mcpServers": {    "github": {      "command": "npx",Removed:       "args": ["-y", "@modelcontextprotocol/server-github"],Added:       "args": ["-y", "@modelcontextprotocol/server-github@2025.4.8"],      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" }    }  }}

When it can be wrong

  • A version fixed somewhere else, such as a global install or a lockfile the launcher never reads, does not count: only the launch line is read.
  • An image tag is reported even when your registry makes tags immutable. An unscoped npm name with a slash, such as npx owner/tool, is read as a GitHub shortcut and is pinned only by #<commit>.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • Skylos reads no inline marker for this rule, even where the file allows comments.

  • Accept a reviewed server with a baseline: skylos baseline ., then --baseline. The entry matches the rule, file, server name and command, not the line. In pull-request CI (SKYLOS_POLICY_BASE), the entry must also be in the base commit's .skylos/baseline.json.

  • [tool.skylos] ignore = ["SKY-D367"] turns the rule off for the whole project.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.