T08 · Insecure Dependencies
- Location
- SKILL.md:41
- Finding
- Unpinned Executable npm Dependency and Unsafe Automatic Upgrades<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:6, 41-46, 66-70` **Vulnerability Type**: Unpinned third-party executable dependency **Risk Level**: High ### Vulnerable Code ```yaml metadata: {"openclaw":{"emoji":"🔥","requires":{"bins":["qhkit"]},"install":[{"kind":"node","package":"@iqinghu/qhkit","bins":["qhkit"]}]}} ``` ```bash npm i -g @iqinghu/qhkit ``` ```bash npx @iqinghu/qhkit <command> ... ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill directs the Agent to download and execute `@iqinghu/qhkit` without pinning an audited version or package integrity value. It also instructs the Agent to install the latest available version when an upgrade condition occurs. Consequently, the effective code executed by the Skill can change after this document has been reviewed. npm lifecycle scripts may also run during installation. A compromise of the package publisher, npm account, package release process, registry, or configured fallback mirror could introduce arbitrary executable code. Using a global installation unnecessarily increases the installation scope. The documented `npx` fallback still retrieves and executes an unpinned package and therefore does not eliminate the supply-chain risk. The Skill also accepts upgrade instructions returned by the external CLI service. Although the documented command is limited to upgrading `qhkit`, automatically following remotely influenced upgrade guidance expands the trust boundary beyond the audited Skill text. ### Attack Path 1. An attacker compromises the package publisher account, release pipeline, npm package, registry response, or fallback mirror. 2. The attacker publishes a malicious version of `@iqinghu/qhkit`, potentially including an npm lifecycle script or malicious CLI implementation. 3. The Agent follows the Skill instructions and runs the unpinned global installation, `npx` command, or `@latest` upgrade. 4. npm downloads and installs the attacker-contr ...[truncated 1012 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specifically reviewed version in both metadata and installation commands. 2. Commit a lockfile containing npm integrity hashes, or independently verify the downloaded package against a trusted digest before execution. 3. Replace `@latest` upgrades with a controlled process that reviews and pins each new release before deployment. 4. Prefer a project-local installation in an isolated directory rather than a global installation. 5. Avoid `npx` execution of an unpinned package. Invoke only the locally installed, version-pinned binary. 6. Disable npm lifecycle scripts with `--ignore-scripts` where the package can function without them. If lifecycle scripts are required, audit them before installation. 7. Require explicit user approval before installing or upgrading executable dependencies. 8. Do not recommend privilege elevation for installation. Use a non-privileged user directory or isolated container. 9. Treat registry mirrors as separate supply-chain trust boundaries and verify identical package integrity before using them. 10. Run the CLI with restricted filesystem access, a minimal environment, and only the network access required for its declared service. ]]>
