T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:55
- Finding
- Unpinned Third-Party CLI Installation and Automatic Upgrade## Vulnerability Details **File Location**: `SKILL.md`, lines 55-62 and 79-81 **Vulnerability Type**: Unpinned executable dependency and mutable supply-chain retrieval **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill directs the agent to install an executable npm package globally without pinning it to a reviewed version. It also instructs the agent to install the mutable `latest` release automatically when certain version signals appear. npm installation can execute package lifecycle scripts, while subsequent CLI invocations execute package-controlled code with the privileges of the agent's operating-system account. Because the resolved package version can change after the Skill has been audited, the effective executable payload is not fixed by the reviewed project. Global installation is broader than necessary for a single image-generation operation. It makes the package available outside the immediate task and may modify user-level or system-level executable paths, depending on npm configuration. The optional registry mirror further expands the supply-chain trust boundary. No evidence shows that the named package is currently malicious. The vulnerability is the unsafe dependency acquisition and upgrade policy. ### Attack Path 1. An attacker compromises the package maintainer account, an authorized publisher, the npm distribution path, or the configured mirror. 2. The attacker publishes a malicious release under the legitimate package name. 3. The agent encounters a system without `qhkit`, or receives one of the documented upgrade signals. 4. The agent executes the unpinned global installation or the `@latest` upgrade. 5. Malicious lifecycle code may execute during installation, or malicious package code executes when `qhkit` is invoked. 6. The payload runs with the privileges of the agent's operating-sy ...[truncated 888 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to an exact version that has been reviewed instead of using an unqualified package name or `@latest`. 2. Record and verify package integrity using a lockfile or an expected registry integrity digest. 3. Do not automatically upgrade in response to remote version messages. Require explicit user or administrator approval before installing a new executable version. 4. Prefer an isolated, project-local installation over global installation. 5. Run the CLI in a sandbox with access restricted to the specific input files and required network destinations. 6. Where compatible with the package, disable npm lifecycle scripts during installation and separately review any required installation scripts. 7. Treat registry mirrors as separate trust boundaries. Document the mirror policy and require the same package-integrity verification regardless of source. 8. Avoid exposing unrelated environment variables or credentials to the installed process.
