T08 · Insecure Dependencies
- Location
SKILL.md:36- Finding
Unpinned npm Package Installation and Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 36–42 and 53–56
Vulnerability Type: Unpinned third-party dependency and mutable source installation
Risk Level: MediumVulnerable code snippets:
bash # Official reference implementation npm install -g @modelcontextprotocol/server-filesystem # Or build from source git clone https://github.com/modelcontextprotocol/servers cd servers/src/filesystem npm install npm run buildjson { "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/yourname/Documents", "/Users/yourname/Projects" ] } } }Technical Analysis
The installation instructions do not pin
@modelcontextprotocol/server-filesystemto an audited version. The MCP configuration also combines an unpinned package name withnpx -y, which permits automatic package retrieval and execution without an interactive confirmation step. Consequently, the code executed can change over time even when the reviewed Skill file remains unchanged.The alternative source-build process clones a mutable repository branch without specifying or verifying an immutable commit or release tag. It then installs the repository's dependency graph and runs its build script. A compromised package release, maintainer account, repository state, or transitive dependency could therefore introduce attacker-controlled installation scripts, build scripts, or server code.
The issue is a supply-chain weakness rather than evidence that the currently referenced project is malicious.
Attack Path
- An attacker compromises the npm package, its publisher account, the source repository, or a transitive dependency.
- The attacker publishes or commits malicious package, lifecycle-script, build-script, or server code.
- A user follows the documented global in ...[truncated 1087 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the npm package to a reviewed exact version, such as
@modelcontextprotocol/server-filesystem@X.Y.Z, rather than relying on the latest registry resolution. - Avoid
npx -yfor security-sensitive server startup. Install the reviewed version locally and invoke its locked executable. - Commit and enforce a lockfile containing package integrity metadata, and use deterministic installation such as
npm ci. - Pin source installations to a reviewed immutable Git commit rather than cloning a mutable default branch.
- Verify release provenance, package signatures or attestations, repository identity, and expected checksums before installation.
- Review npm lifecycle and build scripts before execution, and disable lifecycle scripts where they are unnecessary.
- Prefer a project-local installation over a global installation to reduce scope and improve version isolation.
- Run the MCP server using a dedicated, minimally privileged account or container, with only the required directories mounted.
- Establish a controlled dependency-update process that includes code review, vulnerability scanning, and provenance verification before changing the pinned version.
- Pin the npm package to a reviewed exact version, such as
