T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:29
- Finding
- Unpinned Global Installation of a Third-Party CLI Package## Vulnerability Details **File Location**: `SKILL.md`, line 29 **Vulnerability Type**: Supply-chain exposure through an unpinned, globally installed dependency **Risk Level**: Medium ### Vulnerable Code Snippet ```bash npm i -g @iqinghu/qhkit npm i -g @iqinghu/qhkit --registry=https://registry.npmmirror.com ``` The documentation directs the agent to install `@iqinghu/qhkit` globally when the command is unavailable. It also recommends an alternative package registry if the official source is slow or unavailable. ### Technical Analysis The dependency is installed without a fixed version or integrity validation. Consequently, the package content executed during future installations may differ from the content reviewed when this skill was audited. Global npm installation also expands the potential effect beyond the project directory by placing executable components in a system- or user-wide location. npm packages can execute lifecycle scripts during installation and subsequently run arbitrary package code when their commands are invoked. If the package, one of its transitive dependencies, its publisher account, or the selected registry were compromised, installation could execute attacker-controlled code with the privileges of the user running npm. The alternate registry introduces an additional supply-chain trust boundary. This audit found no evidence that the named package or registry is currently malicious; the vulnerability is the unsafe dependency acquisition and execution process. ### Attack Path 1. An attacker compromises the package publisher, a transitive dependency, or a configured package registry. 2. The attacker publishes or serves a malicious package release under the expected package name. 3. A user invokes the skill on a system where `qhkit` is not installed. 4. The documented unpinned global installation command retrieves the current package version. 5. Malicious npm lifecycle code executes during inst ...[truncated 729 chars]
- Remediation
- ## Remediation Suggestions - Pin the dependency to a specifically reviewed version rather than installing the latest mutable release. - Prefer a project-local installation over `npm i -g` so the dependency remains isolated to the task. - Use a lockfile and verify package integrity hashes before installation. - Review the package and its transitive dependencies before permitting execution. - Disable npm lifecycle scripts during installation where compatible, then explicitly run only reviewed setup operations. - Avoid automatically switching to an alternate registry. If a mirror is necessary, require an explicitly approved registry with provenance and integrity controls. - Run dependency installation and media processing in a restricted container or sandbox with minimal filesystem, network, and credential access. - Do not run the installation command with administrator or root privileges.
