T08 · Insecure Dependencies
Warning
- Location
- skill.json:29
- Finding
- Unpinned npm Package Is Automatically Downloaded and Executed## Vulnerability Details **File Location**: `skill.json`, lines 29–34 **Additional Location**: `README.md`, lines 20–22 **Vulnerability Type**: Unpinned runtime dependency and automatic package execution **Risk Level**: Medium ### Vulnerable Code `skill.json`, lines 29–34: ```json "mcp": { "command": "npx", "args": [ "-y", "@agentdocs1/mcp-server", "--http" ], ``` `README.md`, lines 20–22: ```json "command": "npx", "args": ["-y", "@agentdocs1/mcp-server", "--http"], "env": { ``` ### Technical Analysis The Skill starts its MCP server with `npx -y @agentdocs1/mcp-server --http`. The `-y` option automatically accepts package installation, while the package reference does not specify an exact version or integrity digest. Consequently, the executable code is resolved from the npm registry at installation or launch time and can change after this Skill has been reviewed. A malicious package update, compromised publisher account, or upstream supply-chain compromise could cause arbitrary package lifecycle or server code to execute without further user confirmation. The MCP process receives sensitive configuration through environment variables, including `API_KEY` and `AGENTDOCS_URL`. A compromised dependency could read those variables in addition to exercising the local privileges of the user running the Skill. ### Attack Path 1. An attacker compromises the npm publisher account or release pipeline for `@agentdocs1/mcp-server`, or otherwise causes a malicious release to become the version selected by npm. 2. A user installs or starts the Skill. 3. `npx -y` resolves and downloads the mutable package release without an interactive confirmation. 4. npm executes package installation hooks or the package entry point under the Agent user's local account. 5. The malicious code reads the `API_KEY` and `AGENTDOCS_URL` environment variables supplied to the MCP process. 6. The code can exfiltrate those values, query organizational data available to ...[truncated 964 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `@agentdocs1/mcp-server` to a reviewed, exact version rather than relying on the registry-selected release. 2. Use a committed lockfile and enforce package integrity hashes during installation. 3. Install dependencies during a controlled build or deployment stage instead of downloading them automatically at runtime with `npx -y`. 4. Verify package provenance and signatures where supported, and monitor the dependency for publisher or release anomalies. 5. Run the MCP server in a sandbox or container with restricted filesystem, process, and network access. 6. Supply a short-lived, least-privilege API token limited to the repositories and operations necessary for this Skill. 7. Prevent the MCP process from receiving unrelated environment variables or credentials. 8. Establish an update process that requires security review before changing the pinned package version.
