T08 · Insecure Dependencies
Error
- Location
- SKILL.md:6
- Finding
- Unpinned Third-Party CLI Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:6, 47-50, 68` **Vulnerability Type**: Unpinned executable dependency and unsafe automatic updates **Risk Level**: High ### Complete Code Snippet ```yaml metadata: {"openclaw":{"emoji":"🧰","requires":{"bins":["qhkit"]},"install":[{"kind":"node","package":"@iqinghu/qhkit","bins":["qhkit"]}]}} ``` ```bash npm i -g @iqinghu/qhkit ``` ```text Only when global installation fails due to permissions and privilege elevation is unavailable, fall back to: npx @iqinghu/qhkit <command> ... ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill installs and executes the third-party npm package `@iqinghu/qhkit` without pinning it to an audited version. Both an unversioned package reference and the explicit `@latest` tag allow the downloaded executable content to change after this Skill has been reviewed. The `npx` fallback can download and immediately execute the current registry version. A global npm installation also modifies the user's shared executable environment rather than using a task-local, isolated dependency. Depending on npm configuration and package contents, package lifecycle scripts may execute during installation. This functionality supports the declared image and video generation workflow, but automatic global installation and unrestricted upgrades exceed the minimum privileges necessary. A locally installed, version-pinned package would provide the required functionality with a smaller supply-chain and system-wide impact. ### Attack Path 1. An attacker compromises the npm publisher account, package release process, registry response, or an allowed mirror. 2. The attacker publishes a malicious version under `@iqinghu/qhkit` or causes an unsafe package version to be served. 3. The Agent follows the Skill instructions and runs an unversioned global installation, an `npx` invocation, or an `@latest` upgrade. 4. npm downloads the changed package and may execute its ...[truncated 1040 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to an exact version that has undergone security review. 2. Record and verify package integrity using a lockfile or a trusted SHA-512 integrity value. 3. Remove `@latest` and do not permit automatic version changes based solely on runtime prompts. 4. Prefer a project-local installation in an isolated directory over `npm i -g`. 5. Avoid unversioned `npx` execution. If `npx` is required, specify an exact version and prevent implicit fallback to another package version. 6. Disable npm lifecycle scripts with `--ignore-scripts` where compatible with the package. 7. Require explicit user approval before installing or upgrading executable dependencies. 8. Use only an approved registry and avoid dynamically switching registries unless the mirror is independently trusted and governed. 9. Run the CLI in a sandbox with access limited to the specific input files and required network endpoints. 10. Expose the API token only to the individual CLI process rather than retaining it broadly in the Agent environment. ]]>
