T08 · Insecure Dependencies
Error
- Location
- SKILL.md:45
- Finding
- Unpinned Third-Party CLI Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 45-48 and 66 **Vulnerability Type**: Unpinned npm dependency with global installation and direct execution **Risk Level**: High ### Vulnerable Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The documented fallback directly executes the package through: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade procedure additionally installs the latest available release: ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill installs or executes `@iqinghu/qhkit` without pinning an audited version or package integrity value. Both the implicit current version and the `@latest` tag can resolve to code published after the Skill was reviewed. npm packages can execute code through lifecycle scripts during installation and through their command-line entry points at runtime. A global installation broadens the effect because it modifies the user-wide Node.js environment instead of an isolated project directory. The `npx` fallback also retrieves and executes the package directly when it is not already installed. This dependency is necessary for the declared image-generation functionality, but global, unpinned installation exceeds the minimum safe installation scope. The secondary registry fallback also adds another supply-chain distribution point, although the reviewed text identifies it as a mirror rather than an unrelated package source. ### Attack Path 1. An attacker compromises the npm package, a maintainer account, the publishing pipeline, or an accepted registry distribution path. 2. The attacker publishes a malicious release under the expected package name or causes the unpinned resolution to return compromised content. 3. The Agent follows the Skill instructions and runs `npm i -g @iqinghu/qhkit`, `npm i -g @iqinghu/qhkit@latest`, or `npx @iqinghu/qhkit`. 4. npm lifecycle code or the CLI entry point executes with the permissions of the Agent account. 5. The mal ...[truncated 812 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specifically reviewed version rather than using an implicit version or `@latest`. 2. Record and validate the package integrity hash using a lockfile or equivalent trusted manifest. 3. Remove the instruction to install `@latest` automatically. Upgrades should require explicit review and approval. 4. Install the dependency in an isolated, non-global project directory or disposable container. 5. Run the CLI as a dedicated unprivileged account with access only to the images selected for upload. 6. Disable npm lifecycle scripts where compatible, for example by using `--ignore-scripts`, and separately review any required installation scripts. 7. Restrict the CLI's filesystem and network access through sandboxing or container policy. 8. Treat registry mirrors as separate trust boundaries and verify that retrieved package integrity matches the approved manifest. ]]>
