T08 · Insecure Dependencies
Error
- Location
- README.md:26
- Finding
- Unpinned Third-Party MCP Package Is Automatically Executed with an API Credential## Vulnerability Details **File Location**: `README.md:26-35`; `docs/install.md:10`; `docs/install.md:19-36` **Vulnerability Type**: Unpinned dependency execution with credential exposure **Risk Level**: High ### Vulnerable Code `README.md:26-35`: ```text Add the following to your MCP configuration file (e.g., `claude_desktop_config.json` or your Cursor MCP settings). Note that `npx` will automatically install the server on its first run: ```json { "mcpServers": { "emergence": { "command": "npx", "args": ["-y", "@emergencescience/mcp-server", "run"], "env": { "EMERGENCE_API_KEY": "sk_YOUR_KEY_HERE" ``` `docs/install.md:10`: ```bash npx clawhub install emergence ``` `docs/install.md:19-36`: ```bash npm i @emergencescience/mcp-server ``` ```json { "mcpServers": { "emergence": { "command": "npx", "args": [ "-y", "@emergencescience/mcp-server", "run" ], "env": { "EMERGENCE_API_KEY": "your_api_key_here" } } } } ``` ### Technical Analysis The installation and launch instructions do not pin `@emergencescience/mcp-server` or `clawhub` to an exact audited version and do not specify an integrity hash or lockfile. The `npx -y` configuration permits npm to download and execute a registry-provided package automatically without an interactive approval step. The downloaded MCP process is also explicitly given `EMERGENCE_API_KEY` through its environment. The audited project does not contain the MCP server source code, a package lockfile, or an integrity record, so the effective code receiving this credential cannot be verified from the project artifact. A future package update or a compromise of the package publisher or registry distribution chain could therefore change executable behavior after this Sk ...[truncated 2039 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every npm dependency and `npx` invocation to a specific audited version, such as `@emergencescience/mcp-server@X.Y.Z`. 2. Commit and enforce a package lockfile with integrity hashes. Use `npm ci` rather than unconstrained installation for repeatable deployments. 3. Avoid `npx -y` for security-sensitive services. Install the verified dependency explicitly and launch the local, locked executable. 4. Publish the MCP server source or a reproducible-build record so users can verify the package corresponding to the reviewed version. 5. Verify package provenance and signatures in CI, and reject releases whose integrity or publisher identity does not match an approved policy. 6. Use a narrowly scoped, revocable API token. Separate read-only account access from credit-spending and private-solution access. 7. Run the MCP server in a sandbox with minimal filesystem access, restricted network destinations, no unnecessary environment variables, and a dedicated operating-system identity. 8. Prefer a secret broker or protected credential file over embedding the key directly in general-purpose MCP configuration. Ensure configuration files have restrictive permissions. 9. Require explicit user confirmation for credit-spending operations and enforce configurable transaction limits. 10. Rotate the API key immediately if package compromise or unauthorized account activity is suspected.
