T08 · Insecure Dependencies
- Location
SKILL.md:457- Finding
Unpinned MCP Packages Executed Automatically Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:457-466
Vulnerability Type:T08: Insecure Dependencies
Risk Level: Mediumpython async def main(): mcp_client = MultiServerMCPClient({ "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"], }, "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": {"GITHUB_TOKEN": os.environ["GITHUB_TOKEN"]}, }, })Technical Analysis
The example runs two third-party packages through
npx -ywithout pinning either package to an exact reviewed version. The-yoption suppresses the installation confirmation, while the absence of a version selector permits the package resolved by the registry at execution time to differ from the package available when the Skill was reviewed.This creates a supply-chain execution boundary: package installation and execution occur dynamically, and the effective code is controlled by mutable external registry content. If a package or its publishing account is compromised, a malicious release could execute with the permissions and environment of the Agent process.
The GitHub MCP subprocess receives
GITHUB_TOKEN, and the filesystem MCP subprocess receives access to the configured path. Consequently, compromise of these dependencies could expose sensitive credentials or files. The implementation gate atSKILL.md:487advises validating commands, arguments, environment keys, and credential handling, but it does not require exact dependency pinning, lockfile enforcement, or integrity verification.Attack Path
- An attacker compromises a referenced package, its maintainer account, or its dependency chain and publishes a malicious release.
- A user implements the documented MCP configuration without adding an exact package version.
npx -yresolves and downloads the mutable packag ...[truncated 1091 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin each MCP package to an exact, reviewed version rather than relying on the registry's current resolution, for example:
python "args": [ "-y", "@modelcontextprotocol/server-filesystem@REVIEWED_EXACT_VERSION", "/path", ] -
Prefer installing reviewed dependencies during a controlled build phase and executing the locally installed binaries with automatic runtime installation disabled.
-
Commit and enforce a lockfile, and verify package integrity and provenance in CI before deployment.
-
Run MCP servers in an isolated container or sandbox with restricted filesystem, network, and operating-system permissions.
-
Scope the filesystem server to the smallest required directory and avoid exposing home directories or filesystem roots.
-
Supply a short-lived, least-privilege GitHub token restricted to only the required repositories and operations. Do not reuse broadly privileged personal access tokens.
-
Restrict subprocess environment variables so each MCP server receives only the secrets it requires.
-
Add dependency scanning, release review, and controlled update procedures for MCP packages and their transitive dependencies.
-
