T08 · Insecure Dependencies
Error
- Location
- SKILL.md:14
- Finding
- Unpinned Third-Party Package Is Automatically Downloaded and Executed## Vulnerability Details **File Location**: `SKILL.md`, lines 14-26 **Vulnerability Type**: Unpinned dependency execution through `npx` **Risk Level**: High ```json { "mcpServers": { "crate": { "command": "npx", "args": ["-y", "crate-cli", "--mcp-server"], "env": { "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}" } } } } ``` ### Technical Analysis The MCP configuration invokes `npx` with the package name `crate-cli` but does not specify an exact package version or integrity hash. The `-y` option automatically approves package installation and execution without interactive confirmation. Consequently, the code executed when the MCP server starts is determined by the package registry at installation time rather than by the reviewed skill artifact. A malicious package update, compromised maintainer account, or registry compromise could cause arbitrary attacker-controlled JavaScript to execute locally. The package process runs with the permissions of the user who launches the agent and also receives the configured environment variables. ### Attack Path 1. An attacker compromises the `crate-cli` package, its publisher account, or its package publication pipeline. 2. The attacker publishes a malicious version under the same package name. 3. A user installs or loads the skill and starts the configured MCP server. 4. `npx -y crate-cli --mcp-server` resolves and downloads the current package version without requiring approval. 5. Package installation hooks or runtime code execute with the agent user's operating-system permissions. 6. The malicious process can access files, network resources, inherited credentials, and other resources available to that user. ### Impact Assessment Successful exploitation can result in arbitrary code execution under the account running the agent. The accessible scope may include user-readable files, writable project data, network-accessible ...[truncated 249 chars]
- Remediation
- ## Remediation Suggestions - Pin `crate-cli` to a specific, reviewed version, such as `crate-cli@0.2.3`, rather than resolving the latest release. - Install the dependency through a committed lockfile and enforce package integrity verification. - Prefer a preinstalled executable from a trusted, reproducible build instead of downloading code automatically when the MCP server starts. - Remove `-y` so unexpected installation or resolution behavior does not proceed silently. - Review package installation scripts, transitive dependencies, provenance attestations, and publisher history before deployment. - Run the MCP server in a sandbox or container with restricted filesystem access, network egress, and operating-system permissions. - Monitor and explicitly approve dependency updates rather than accepting mutable upstream behavior automatically.
