T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:48
- Finding
- Unpinned Third-Party Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 48-55 **Vulnerability Type**: Unpinned npm dependency and unsafe supply-chain execution **Risk Level**: Medium ### Vulnerable Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The surrounding instructions also permit direct execution through: ```bash npx @iqinghu/qhkit <command> ... ``` The package is declared without an exact version: ```yaml metadata: {"openclaw":{"emoji":"🎨","requires":{"bins":["qhkit"]},"install":[{"kind":"node","package":"@iqinghu/qhkit","bins":["qhkit"]}]}} ``` ### Technical Analysis The Skill installs or executes the mutable `@iqinghu/qhkit` npm package without pinning an audited version or verifying package integrity. Both the global installation and the `npx` fallback can retrieve whichever package version the selected registry currently resolves. An npm package can execute code through installation lifecycle scripts and through its command-line entry point. Consequently, compromise of the package publisher, npm account, registry infrastructure, or configured mirror could cause attacker-controlled code to execute during installation or use. The global installation scope is also broader than necessary. Although the document does not instruct the user to obtain root privileges and recommends `npx` after a permission failure, a global package can affect commands available across the Agent user's environment. ### Attack Path 1. An attacker compromises the `@iqinghu/qhkit` publisher account, release process, official registry record, or permitted mirror. 2. The attacker publishes or serves a malicious version under the legitimate package name. 3. The Skill detects that `qhkit` is unavailable and runs the unpinned global installation or `npx` command. 4. npm resolves the attacker-controlled version because no exact version or integrity value is required. 5. Malicious lifecycle or CLI code executes with the privileges of the account running the Agent. 6. The ma ...[truncated 654 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specific, reviewed version instead of relying on the registry's current resolution. 2. Record and validate the package integrity hash through a lockfile or equivalent trusted manifest. 3. Prefer a project-local installation over `npm i -g` to limit environmental impact. 4. Avoid unpinned `npx` execution. If `npx` is required, specify an exact version and prevent implicit substitution with another release. 5. Use `npm ci` with a committed lockfile where feasible. 6. Disable npm lifecycle scripts with `--ignore-scripts` if the package functions without them. 7. Treat third-party mirrors as separate trust boundaries and require equivalent integrity verification. 8. Require explicit user approval before installing or changing executable dependencies. ]]>
