T08 · Insecure Dependencies
Error
- Location
- SKILL.md:6
- Finding
- Unpinned npm Package Is Installed and Executed Globally<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 6 and 43–66 **Vulnerability Type**: Unpinned and mutable 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 retrieve and execute the `@iqinghu/qhkit` npm package without pinning it to an audited version. It also explicitly instructs the Agent to install the latest available release and permits execution through `npx`. Consequently, the code executed during a future invocation is not necessarily the code that existed when the Skill was reviewed. An npm publisher-account compromise, malicious package update, registry compromise, dependency compromise, or unsafe mirror response could introduce arbitrary code. npm lifecycle scripts may execute during installation, while the installed CLI executes afterward as part of the Skill's normal workflow. Global installation is broader than necessary for the declared video-generation task. It changes the Agent user's shared environment and exposes other sessions to the installed executable. Automatically following upgrade instructions returned by the existing CLI further delegates control over local code installation to mutable external software. The separate Node.js bootstrap pipeline does not directly pipe downloaded shell code into a shell. It downloads an archive and checks it using a remotely supplied checksum before extraction. However, because the archive and checksum are obtained from the same origin or mirror, this verification detects corruption but does not fully protect against compromise of that distribution origin. ### Attack Path 1. An attacker compromises the npm publisher account ...[truncated 1302 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specifically reviewed version rather than using an implicit current version or `@latest`. 2. Record and verify the expected npm integrity digest or a publisher signature before installation. 3. Use a project-local, isolated installation directory instead of `npm -g`. 4. Run the CLI in a restricted container or sandbox with access only to the required input files and network endpoints. 5. Disable npm lifecycle scripts with `--ignore-scripts` when the package can operate without them. If scripts are required, audit them before execution. 6. Do not automatically execute upgrade commands returned by the CLI. Require explicit user approval and validate the target version against an approved list. 7. Pin transitive dependencies through a reviewed lockfile where deployment architecture permits it. 8. Avoid switching to a third-party registry mirror without equivalent integrity and provenance controls. 9. For the Node.js bootstrap, verify a signed checksum manifest or use an independently pinned digest rather than relying solely on a checksum downloaded from the same origin as the archive. ]]>
