T08 · Insecure Dependencies
Error
- Location
- skill.json:26
- Finding
- Unpinned npm Dependency Is Downloaded and Executed Without Confirmation## Vulnerability Details **File Location**: `skill.json:26-32`; duplicated installation pattern in `README.md:17-28` **Vulnerability Type**: Supply-chain exposure through automatic execution of an unpinned third-party package **Risk Level**: High ### Vulnerable Code `skill.json:26-32`: ```json "mcp": { "command": "npx", "args": [ "-y", "@agentdocs1/mcp-server", "--http" ], ``` `README.md:17-28`: ```json { "mcpServers": { "uplo-healthcare": { "command": "npx", "args": ["-y", "@agentdocs1/mcp-server", "--http"], "env": { "AGENTDOCS_URL": "https://your-instance.uplo.ai", "API_KEY": "your-api-key", "DEFAULT_PACKS": "healthcare" } } } } ``` ### Technical Analysis The Skill launches `@agentdocs1/mcp-server` through `npx -y` without specifying an exact package version or integrity digest. If the package is absent locally, `npx` can retrieve the currently resolved version from the configured npm registry. The `-y` option suppresses the normal installation confirmation. Consequently, the code executed when the Skill starts is not immutable and can differ from the code that existed when this project was reviewed. A compromised npm publisher account, malicious package release, registry compromise, or unsafe registry substitution could introduce attacker-controlled code. Because npm packages can execute JavaScript and lifecycle behavior with the privileges of the invoking user, this is a direct supply-chain execution boundary. The README reproduces the same unsafe configuration for users, while `skill.json` makes it part of the Skill's operational configuration. ### Attack Path 1. An attacker compromises the `@agentdocs1/mcp-server` publisher account, its release pipeline, or a registry trusted by the target environment. 2. The attacker publishes a malicious version that resolves when no explicit version is reques ...[truncated 1313 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to an exact reviewed version, for example `@agentdocs1/mcp-server@X.Y.Z`; do not use version ranges or distribution tags. 2. Install dependencies during a controlled build or deployment phase rather than downloading them dynamically whenever the Skill starts. 3. Commit and enforce a lockfile containing registry-resolved integrity hashes. Use deterministic installation such as `npm ci`. 4. Configure the package manager to use an explicitly trusted registry and reject unexpected registry overrides. 5. Verify package provenance, signatures, and integrity metadata in CI before deployment. 6. Remove `-y` from interactive setup paths where automatic approval is unnecessary. 7. Run the MCP server in a sandbox or dedicated low-privilege account with narrowly restricted filesystem and network access. 8. Provide only the minimum-scope API token required for supported operations and rotate it if dependency compromise is suspected. 9. Update both `skill.json` and the README example so documentation does not instruct users to restore the unsafe behavior. 10. Establish dependency monitoring and require security review before changing the pinned package version.
