T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:57
- Finding
- Unpinned Global Installation of a Mutable Third-Party CLI## Vulnerability Details **File Location**: `SKILL.md`, lines 57–86 **Vulnerability Type**: Unsafe third-party dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` The documented upgrade procedure later installs the mutable latest release: ```bash npm i -g @iqinghu/qhkit@latest ``` The instructions also permit switching from the official npm registry to: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill instructs the agent to install a third-party npm package globally without pinning an audited version or verifying package integrity. The upgrade procedure explicitly requests the `latest` tag, whose target can change after the Skill has been audited. npm installation can execute package lifecycle scripts and place executables in a global binary location. Consequently, the effective code executed by the Skill is controlled by future package releases and the selected registry rather than by the reviewed `SKILL.md` file. The registry fallback additionally expands the supply-chain trust boundary. No evidence establishes that the named package or mirror is currently malicious. The vulnerability is the mutable, unverified, global installation mechanism. ### Attack Path 1. An attacker compromises the package publisher account, package release process, or an accepted registry path. 2. The attacker publishes a malicious release and moves the `latest` tag to it, or serves a compromised package through the registry path. 3. A user invokes the Skill on a system without `qhkit`, or the CLI reports that an upgrade is required. 4. The agent runs the documented global npm installation command. 5. Malicious lifecycle scripts or CLI code execute with the operating-system privileges of the agent process. 6. The installed global executable remains available to later shell sessions until removed or replaced. ### Impact Assessment ...[truncated 615 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specifically reviewed version rather than using an unqualified package name or `@latest`. 2. Verify the package using an approved lockfile and npm integrity metadata. 3. Prefer a project-local, isolated installation over `npm i -g`. 4. Disable lifecycle scripts during installation where compatible, then explicitly run only reviewed setup steps. 5. Restrict installation to an administrator-approved registry and avoid automatic registry fallback. 6. Require explicit user approval before installing or upgrading executable dependencies. 7. Review each new version before changing the pinned version. 8. Run the CLI in a sandbox with access limited to the media files and network destinations required for the requested task.
