T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:50
- Finding
- Unpinned Third-Party CLI Is Downloaded and Executed Through npx<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:50-55` **Additional Locations**: The unpinned `npx mcporter` invocation is repeated throughout `examples/*.md`. **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```bash # 1. Use mcporter with npx (no installation needed) # Or install globally: npm i -g mcporter # 2. Register the server cd ~/.openclaw/workspace npx mcporter config add ops-mcp-server --url http://localhost/mcp ``` ### Technical Analysis The setup instructions execute `mcporter` by package name without pinning an exact version. When the package is not already available locally, `npx` can retrieve the currently resolved release from the configured npm registry and execute its package lifecycle or command code. The alternative global installation command, `npm i -g mcporter`, is similarly unpinned. The project provides no lockfile, integrity hash, verified package provenance, or publisher validation. Consequently, the code executed by users may differ from the code that was reviewed when this Skill was published. This creates a supply-chain exposure if the npm package, publisher account, dependency graph, package registry, or local npm registry configuration is compromised. It may also expose users to an unintended package selected through registry substitution or name confusion. ### Attack Path 1. An attacker compromises the resolved `mcporter` package, one of its dependencies, its publisher account, or an npm registry used by the victim. 2. The attacker publishes or serves a malicious package version under the name resolved by `npx mcporter`. 3. A user follows the documented setup or example instructions. 4. `npx` downloads and executes the unpinned package, or the user installs it globally with `npm i -g mcporter`. 5. Malicious package code executes with the operating-system privileges of the invoking user. 6. The code may access the user's workspace, npm configur ...[truncated 854 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `mcporter` to an audited exact version in every command, for example: ```bash npx --yes mcporter@<verified-exact-version> ... ``` 2. Verify the package's publisher, registry origin, and release provenance before recommending it. 3. Use a lockfile and npm integrity metadata where installation is managed as part of a project. 4. Prefer a locally installed, reviewed dependency invoked with `npm exec --offline` or an equivalent mechanism that does not silently retrieve changing code. 5. Document the expected package checksum or signed release verification process. 6. Avoid recommending global installation because it expands the duration and scope of exposure. 7. Configure CI to detect unpinned `npx`, `npm install`, and equivalent dependency executions in documentation and scripts. 8. Run the CLI with a dedicated low-privilege account and expose only the minimum MCP credentials required for the task. ]]>
