T08 · Insecure Dependencies
Error
- Location
- SKILL.md:39
- Finding
- Unpinned Third-Party Package Installation with Global Execution Scope<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 39–44 and 59–64 **Vulnerability Type**: Supply-chain exposure through mutable npm packages **Risk Level**: High ### Complete Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The fallback also permits direct package retrieval and execution: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade procedure explicitly retrieves the mutable latest release: ```bash npm i -g @iqinghu/qhkit@latest ``` The instructions additionally permit using a registry mirror: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill instructs the agent to install and execute `@iqinghu/qhkit` without pinning an exact audited version or package integrity value. The `@latest` upgrade instruction is explicitly mutable, while the unversioned `npm i` and `npx` forms resolve according to registry state at execution time. npm package installation can execute lifecycle scripts and place executable code on the host. A global installation unnecessarily broadens the installation scope compared with a project-local or isolated installation. Using `npx` does not remove the supply-chain risk because it can download and immediately execute the currently resolved package. The optional registry mirror creates another delivery path whose package contents are not independently pinned in the Skill. There is no evidence that the named package or mirror is currently malicious; the vulnerability is the unsafe trust and execution model. ### Attack Path 1. An attacker compromises the package maintainer account, package release process, upstream dependency, or a permitted registry delivery path. 2. The attacker publishes a malicious version under the legitimate package name or modifies a transitive dependency. 3. The Skill encounters a missing CLI, a version warning, or another documented upgrade condition. 4. The agent runs the unpinned global installation, `npx` fallback, or `@latest` upgrade ...[truncated 916 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specific reviewed version rather than using an unversioned package or `@latest`. 2. Record and verify the expected package integrity hash through a lockfile or equivalent integrity mechanism. 3. Prefer a project-local, isolated installation over `npm i -g`. 4. Avoid automatic upgrades based solely on CLI output or remote version notices. Require explicit user approval and validate the proposed version against an allowlist. 5. Do not use `npx` for implicit download-and-execute behavior. If it is unavoidable, specify an exact version and use a controlled npm cache or vetted registry. 6. Disable npm lifecycle scripts during installation where compatible, then explicitly run only reviewed setup steps. 7. Treat registry mirrors as separate supply-chain trust boundaries. Permit only administratively approved registries and retain integrity verification regardless of source. 8. Execute the CLI in a sandbox with minimal filesystem, environment-variable, and network access. ]]>
