T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:43
- Finding
- Unpinned Global Installation of a Mutable npm Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 43–46 and 58–64 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium ### Complete Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The upgrade instructions also use a mutable release tag: ```bash npm i -g @iqinghu/qhkit@latest ``` The Skill additionally permits installation through this fallback registry: ```bash npm i -g @iqinghu/qhkit --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill directs the Agent to install `@iqinghu/qhkit` globally without pinning an audited version or package integrity digest. The `latest` tag is explicitly used during upgrades, so the installed code can change after the Skill itself has been reviewed. npm installation can run package lifecycle scripts. A malicious or compromised package release could therefore execute code with the permissions of the user running npm. Global installation also modifies a shared user or system-level tool environment rather than creating a task-scoped, isolated dependency. The fallback mirror creates an additional supply-chain trust boundary. Although the documented package name appears intentional and no evidence shows that the current package is malicious, the installation procedure does not independently verify package provenance or integrity. ### Attack Path 1. An attacker compromises the npm publisher account, package release process, registry response, or permitted mirror. 2. The attacker publishes or serves a modified version of `@iqinghu/qhkit`, potentially under the mutable `latest` tag. 3. The Agent follows the Skill instructions and performs a global npm installation or upgrade. 4. npm downloads the attacker-controlled package. 5. Package lifecycle scripts execute with the invoking user's privileges, or the installed `qhkit` executable runs malicious logic later. 6. The malicious package can access files, environment variables, API tokens, and network resources ...[truncated 698 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specifically audited version rather than using an unqualified package name or `@latest`. 2. Verify package integrity using a trusted lockfile, expected npm integrity digest, or independently published checksum. 3. Install the dependency in a task-scoped directory or isolated container instead of globally. 4. Require explicit user approval before modifying the environment or installing dependencies. 5. Avoid alternate registries unless necessary and explicitly approved. Apply the same integrity verification regardless of the selected registry. 6. Consider disabling lifecycle scripts during installation where compatible, then invoke only reviewed package entry points. 7. Document the expected publisher, version, integrity value, and resolved registry before installation. ]]>
