T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:18
- Finding
- Unpinned Third-Party Package Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 18-25 **Vulnerability Type**: Unpinned and automatically executed npm dependencies **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 Prefer MCP tools over shell commands? The same platform is exposed by [`@wavespeed/mcp`](https://github.com/WaveSpeedAI/mcp-server) (`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` without an exact version, lockfile, or package-integrity verification. They also invoke `npx -y @wavespeed/mcp`, which automatically downloads the currently resolved package release, approves installation without user confirmation, and executes its code. Both package references are mutable because no version is pinned. Consequently, the code executed by users may differ from the version that was available when the Skill was reviewed. npm package installation can execute lifecycle scripts, while an MCP package invoked through `npx` runs its application entry point. Either mechanism can execute arbitrary code with the permissions of the invoking user. This finding does not establish that the named packages are currently malicious. The vulnerability is the unsafe dependency acquisition and execution pattern, which creates a supply-chain attack surface. ### Attack Path 1. An attacker compromises the publisher account, package release process, package registry entry, or a transitive dependency associated with one of the referenced packages. 2. The attacker publishes a malicious release that becomes the version selected by npm's default resolution behavior. 3. A user follows the Skill instructions and runs either `npm install -g ...[truncated 1210 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 automatic `npx -y` execution with a locally declared dependency installed from a committed lockfile. 3. Use `npm ci` with a reviewed `package-lock.json` so dependency resolution is reproducible. 4. Verify package provenance and integrity through npm integrity metadata, trusted publisher information, signatures, or published checksums before execution. 5. Avoid global installation where possible. Install the CLI in a dedicated project or isolated environment with minimal filesystem and credential access. 6. Review package lifecycle scripts and dependency changes before upgrading pinned versions. 7. Do not run package installation or MCP execution with administrator or root privileges. 8. For automated environments, constrain network access, filesystem access, and available environment variables while installing or running the packages.
