T08 · Insecure Dependencies
Error
- Location
- SKILL.md:45
- Finding
- Execution of Mutable, Unpinned npm Package Releases<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 45-48 and 63-66 **Vulnerability Type**: Supply-chain exposure through unpinned third-party package installation **Risk Level**: High ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npx @iqinghu/qhkit <command> ... ``` ```bash npm i -g @iqinghu/qhkit@latest ``` The instructions also permit changing the package source to: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill installs and executes `@iqinghu/qhkit` without pinning an audited version or package integrity value. The explicit use of `@latest` makes the installed code mutable after the Skill itself has been reviewed. The `npx` fallback can similarly retrieve and immediately execute package content. npm packages may execute lifecycle scripts during installation, and the installed CLI subsequently runs with the permissions of the Agent process. Global installation unnecessarily increases the affected installation scope compared with a local, isolated dependency. Permitting a registry mirror also introduces another supply-chain trust point, even though the documented mirror is presented as a network fallback. This behavior is needed only to obtain the declared image-generation client; global installation and mutable-version execution exceed the minimum necessary privilege and trust scope. ### Attack Path 1. An attacker compromises the package maintainer account, package release process, registry response, or allowed mirror. 2. The attacker publishes malicious content under the expected package name or mutable latest version. 3. The Agent follows the Skill instructions and runs `npm i -g`, `npm i -g ...@latest`, or `npx`. 4. npm retrieves the attacker-controlled release. 5. Malicious lifecycle scripts execute during installation, or malicious code executes when the CLI is invoked. 6. The payload gains access to the Agent process's files, environment variables, network access, ...[truncated 569 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specifically reviewed version rather than using an unqualified package or `@latest`. 2. Lock and verify the package integrity hash before installation. 3. Remove the instruction to execute package content through an unpinned `npx` invocation. 4. Install the dependency locally in a dedicated, restricted directory or container rather than globally. 5. Run installation and execution as an unprivileged account with access only to the images required for the current request. 6. Disable npm lifecycle scripts where compatible, for example with `--ignore-scripts`, and separately review any required installation scripts. 7. Require explicit review and approval before changing package versions or registries. 8. Prefer a trusted internal package mirror with provenance verification and allowlisted artifacts. ]]>
