T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:20
- Finding
- Unpinned Third-Party Packages Are Installed and Executed## Vulnerability Details **File Location**: `SKILL.md`, lines 20–27 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```bash npm install -g @wavespeed/cli wavespeed login # opens https://wavespeed.ai/accesskey and stores the key wavespeed status # confirms you are signed in ``` ```text For CI or one-off shells, `WAVESPEED_API_KEY` in the environment also works. Prefer MCP tools over shell commands? The same platform is exposed by `@wavespeed/mcp` (`npx -y @wavespeed/mcp`; tools `search_models`, `get_model_schema`, `get_price`, `upload_file`, `run_model`, `get_prediction`). ``` ### Technical Analysis The instructions install `@wavespeed/cli` globally and execute `@wavespeed/mcp` through `npx -y` without specifying reviewed package versions or verifying package integrity. Both commands therefore resolve the package version from the registry at execution time. The global installation can run package lifecycle scripts and modify the user-wide Node.js environment. Likewise, `npx -y` downloads and executes the currently resolved package without an interactive confirmation. If the package account, registry, publication process, or latest release is compromised, code different from the version originally reviewed can execute under the invoking user's account. This is a supply-chain exposure rather than evidence that the named packages are currently malicious. ### Attack Path 1. An attacker compromises the package maintainer account, package publication pipeline, or package registry response. 2. The attacker publishes or serves a malicious release under `@wavespeed/cli` or `@wavespeed/mcp`. 3. A user follows the documented setup and runs the unpinned `npm install -g` or `npx -y` command. 4. npm resolves the attacker-controlled release because no exact version or integrity digest is required. 5. Malicious lifecycle or runtime code exec ...[truncated 743 chars]
- Remediation
- ## Remediation Suggestions 1. Pin each dependency to an exact, reviewed version, for example `@wavespeed/cli@X.Y.Z` and `@wavespeed/mcp@X.Y.Z`. 2. Replace global installation with a project-local dependency managed through a committed lockfile. 3. Use `npm ci` in automated environments so dependency resolution must match the lockfile. 4. Verify package provenance and registry integrity before installation; where supported, enforce npm provenance attestations and known integrity hashes. 5. Avoid `npx -y` for security-sensitive execution. Install a pinned MCP package in a controlled environment and invoke that installed version. 6. Disable dependency lifecycle scripts where they are unnecessary, such as with `--ignore-scripts`, after confirming that the reviewed package functions correctly without them. 7. Run the tools in a least-privileged container or isolated account with access only to the media and credentials required for the current operation. 8. Document a tested version-upgrade and security-review process rather than implicitly tracking the latest registry release.
