T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:81
- Finding
- Unpinned Third-Party CLI Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 81-86 **Vulnerability Type**: Supply-chain risk from unpinned npm package installation **Risk Level**: Medium ### Vulnerable Code ```bash # No qhkit but node/npm is available: install globally npm i -g @iqinghu/qhkit ``` The accompanying instructions also permit direct execution through an unpinned package: ```bash npx @iqinghu/qhkit <command> ... ``` A related upgrade instruction at lines 101-104 explicitly installs the mutable latest release: ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The installation and fallback commands do not pin `@iqinghu/qhkit` to a specific audited version or package integrity hash. Both the implicit latest version and the explicit `@latest` tag can change after this Skill has been reviewed. npm package installation may execute package lifecycle scripts, while subsequent invocation executes the installed package with the permissions of the current user. The global installation mode also places executable content in a shared user-level or system-level npm location rather than isolating it to the Skill's working directory. The documentation additionally permits use of `registry.npmmirror.com` as a fallback registry. Although this may be operationally useful, it introduces another supply-chain trust boundary. The audit did not find evidence that the named package or mirror is currently malicious; the vulnerability is the absence of version and integrity controls. ### Attack Path 1. An attacker compromises the package publisher account, package distribution channel, or an allowed registry. 2. The attacker publishes a malicious release under the package's current default or `latest` version. 3. The agent follows the Skill instructions and runs the unpinned global installation, `npx` fallback, or automatic upgrade. 4. npm lifecycle code or the subsequently invoked CLI executes with the instal ...[truncated 768 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the CLI to an exact reviewed version, for example: ```bash npm install --save-exact @iqinghu/qhkit@0.10.0 ``` 2. Verify the selected package using an approved lockfile and npm integrity metadata. 3. Remove automatic `@latest` upgrades. Require explicit user approval and security review before changing versions. 4. Prefer a project-local installation over `npm i -g` to reduce installation scope. 5. If `npx` is retained, specify an exact version and prevent package substitution: ```bash npx --yes @iqinghu/qhkit@0.10.0 ... ``` 6. Use only explicitly approved registries and document the trust implications of any mirror. 7. Run the CLI under a restricted, non-administrative account with access limited to the files required for the requested workflow.
