T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:20
- Finding
- Unpinned Third-Party Packages Are Downloaded and Executed Locally## Vulnerability Details **File Location**: `SKILL.md`, lines 20-27 **Vulnerability Type**: Unpinned npm dependencies and automatic execution of remotely retrieved package code **Risk Level**: Medium The setup instructions install or execute third-party npm packages without pinning them to reviewed versions: ```bash npm install -g @wavespeed/cli wavespeed login wavespeed status ``` ```text npx -y @wavespeed/mcp ``` ### Technical Analysis Both package references omit an explicit version. Consequently, npm resolves whichever release is current when the command is run, rather than a release whose contents were reviewed with this skill. `npm install -g @wavespeed/cli` installs a package globally and may execute npm lifecycle scripts during installation. Its effective permissions depend on the user's npm configuration and whether the command is run with elevated privileges. `npx -y @wavespeed/mcp` retrieves and executes the resolved package while suppressing the normal installation confirmation. This creates a remote code execution channel controlled by the contents of the package version available from the configured npm registry at execution time. This does not establish that either named package is currently malicious. The vulnerability is the absence of version locking and integrity controls, which exposes users to package-account compromise, malicious releases, compromised transitive dependencies, registry substitution, and dependency-resolution attacks. ### Attack Path 1. An attacker compromises the package publisher, npm package, registry path, or a transitive dependency. 2. The attacker publishes a malicious release that satisfies the unpinned package reference. 3. A user follows the documented setup and executes either `npm install -g @wavespeed/cli` or `npx -y @wavespeed/mcp`. 4. npm resolves and downloads the attacker-controlled release. 5. Malicious code executes through an installation lifecycle scr ...[truncated 920 chars]
- Remediation
- ## Remediation Suggestions 1. Pin both packages to exact, reviewed versions, for example: ```bash npm install -g @wavespeed/cli@<reviewed-version> npx -y @wavespeed/mcp@<reviewed-version> ``` 2. Prefer a project-local dependency managed by a committed lockfile over global installation or ad hoc `npx` execution. 3. Install with `npm ci` from a reviewed `package-lock.json` so dependency versions and integrity hashes are enforced. 4. Verify the expected package publisher, package provenance, signatures, and registry before installation. 5. Avoid running npm installation commands with administrator or root privileges. 6. Consider disabling lifecycle scripts during installation when package functionality permits, then explicitly run only reviewed entry points. 7. Audit direct and transitive dependencies regularly and define a controlled process for reviewing and updating pinned versions. 8. Run the CLI or MCP server in a restricted environment with access only to the media and credentials required for the current operation.
