T08 · Insecure Dependencies
Error
- Location
- SKILL.md:37
- Finding
- Unpinned Third-Party CLI Is Installed and Executed Globally<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 37–43 **Vulnerability Type**: Third-party supply-chain exposure through an unpinned global package installation **Risk Level**: High ### Vulnerable Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The fallback installation mechanism is: ```bash npx @iqinghu/qhkit <command> ... ``` The instructions also permit changing the package source to: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill requires the Agent to retrieve and execute the third-party `@iqinghu/qhkit` package, but it does not pin an exact package version or integrity digest. The package implementation is not included in the audited project, so its behavior cannot be verified from the repository. A global npm installation increases the impact of dependency compromise because it places executable content in the user's global npm environment. The `npx` fallback can likewise retrieve and immediately execute a mutable package release. npm lifecycle scripts may run during installation unless explicitly disabled. Using an alternate registry adds another package-distribution trust boundary. Although the documented mirror is presented as a network fallback and there is no evidence that it is malicious, package availability or integrity discrepancies between registries could increase supply-chain exposure. The global installation is broader than the minimum privileges required to invoke a task-specific CLI. A project-local, isolated, and version-pinned installation would reduce the affected scope. ### Attack Path 1. An attacker compromises the npm package publisher account, package distribution infrastructure, or an accepted registry response. 2. The attacker publishes a malicious release under the expected package name. 3. The Agent follows the Skill instructions and runs the unpinned global installation or `npx` command. 4. Malicious lifecycle code may execute during installation, or mal ...[truncated 951 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a reviewed, exact version rather than resolving an unspecified or mutable release. 2. Record and verify the package integrity digest or lockfile integrity metadata. 3. Prefer a project-local installation in an isolated directory or container instead of `npm i -g`. 4. Avoid automatic `npx` retrieval. If `npx` is required, specify an exact reviewed version. 5. Disable npm lifecycle scripts with `--ignore-scripts` where compatible with the package. 6. Audit the package contents, transitive dependencies, and lifecycle hooks before authorizing execution. 7. Restrict package installation and execution with filesystem, network, and environment-variable sandboxing. 8. Use a single trusted registry with integrity verification. Do not silently switch registries. 9. Request explicit user approval before installing or upgrading executable dependencies. ]]>
