T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:36
- Finding
- Unpinned npm Package Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 36–42 and 53–56 **Vulnerability Type**: Unpinned third-party dependency and mutable source installation **Risk Level**: Medium **Vulnerable 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 build ``` ```json { "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-filesystem` to an audited version. The MCP configuration also combines an unpinned package name with `npx -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 1. An attacker compromises the npm package, its publisher account, the source repository, or a transitive dependency. 2. The attacker publishes or commits malicious package, lifecycle-script, build-script, or server code. 3. A user follows the documented global in ...[truncated 1087 chars]
- Remediation
- ## Remediation Suggestions 1. 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. 2. Avoid `npx -y` for security-sensitive server startup. Install the reviewed version locally and invoke its locked executable. 3. Commit and enforce a lockfile containing package integrity metadata, and use deterministic installation such as `npm ci`. 4. Pin source installations to a reviewed immutable Git commit rather than cloning a mutable default branch. 5. Verify release provenance, package signatures or attestations, repository identity, and expected checksums before installation. 6. Review npm lifecycle and build scripts before execution, and disable lifecycle scripts where they are unnecessary. 7. Prefer a project-local installation over a global installation to reduce scope and improve version isolation. 8. Run the MCP server using a dedicated, minimally privileged account or container, with only the required directories mounted. 9. Establish a controlled dependency-update process that includes code review, vulnerability scanning, and provenance verification before changing the pinned version.
