T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:35
- Finding
- Unpinned Global Installation of a Third-Party CLI Package## Vulnerability Details **File Location**: `SKILL.md`, lines 35–42 and 57–63 **Vulnerability Type**: Unsafe and unpinned third-party dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npm i -g @iqinghu/qhkit@latest ``` The instructions install `@iqinghu/qhkit` globally without pinning it to an audited version or integrity value. The upgrade procedure explicitly installs the latest available release. As a result, the package executed by the agent can differ from the version that existed when the Skill was reviewed. npm packages may execute lifecycle scripts during installation. A global installation makes the package and its commands available across the user environment rather than limiting them to an isolated project directory. This exceeds the minimum installation scope necessary to invoke the CLI for one task. ### Technical Analysis The security of the Skill depends on the continued integrity of the npm package, its publisher account, its transitive dependencies, and the selected registry. If any part of that supply chain is compromised, a malicious release could execute code during installation or when `qhkit` is subsequently invoked. The documented mirror fallback introduces another source from which package metadata and content may be obtained. No lockfile, exact package version, npm integrity value, signature verification, or independent package validation is specified. ### Attack Path 1. An attacker compromises the npm publisher account, package, registry path, mirror, or a transitive dependency. 2. The attacker publishes a malicious release as the current or latest version. 3. The agent follows the Skill instructions and runs the global installation or upgrade command. 4. Malicious lifecycle code may execute during installation, or malicious package code may execute when `qhkit` is invoked. 5. The payload operates with the permissions of the ...[truncated 614 chars]
- Remediation
- ## Remediation Suggestions - Pin `@iqinghu/qhkit` to a specific audited version rather than installing an unqualified or `latest` release. - Use a lockfile and verify npm integrity metadata before installation. - Prefer a project-local, user-scoped, or isolated installation instead of a global installation. - Require explicit user approval before installing or upgrading third-party software. - Do not automatically upgrade solely because a package or remote service reports that a newer version exists. - Review transitive dependencies and package lifecycle scripts before approving a release. - Consider using `npm install --ignore-scripts` when the package can operate without lifecycle scripts. - Restrict execution through sandboxing, a container, or a dedicated low-privilege account.
