T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:42
- Finding
- Unpinned Global Installation and Execution of Third-Party npm Packages<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:42-45` and `SKILL.md:63-66` **Vulnerability Type**: Supply-chain exposure through unpinned dependencies and download-on-demand execution **Risk Level**: Medium ### Complete Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The instructions also permit download-on-demand execution: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade procedure explicitly installs the latest available release: ```bash npm i -g @iqinghu/qhkit@latest ``` Both installation paths may use an alternative registry: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill installs and executes `@iqinghu/qhkit` without pinning an audited version or package integrity value. The `@latest` upgrade path intentionally resolves to mutable package content, while the `npx` fallback can download and execute package code immediately. npm packages can run executable CLI code and may also run lifecycle scripts during installation. Consequently, the effective code executed by this Skill is not fully represented by the audited `SKILL.md` file and can change after the audit. Using a global installation also broadens the modification scope beyond a task-specific directory. Depending on npm configuration, it can modify user-level or system-level executable locations. The instructions do not request privilege elevation and explicitly acknowledge permission failures, so no privilege escalation is demonstrated; execution remains limited to the privileges of the Agent process. The alternative registry is described as a fallback, but it expands the number of supply-chain systems that must remain trustworthy. ### Attack Path 1. An attacker compromises the npm package, a maintainer account, the publication process, or a permitted registry. 2. The attacker publishes a malicious release under the legitimate package name. 3. The Agent runs `npm i -g @iqinghu/qhkit`, `npm i -g @iqinghu/qhkit@latest`, or t ...[truncated 1207 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specific, reviewed version rather than using an unqualified package name or `@latest`. 2. Record and verify the expected package integrity digest before execution. 3. Use a lockfile and a project-local installation in an isolated working directory instead of a global installation. 4. Avoid `npx` download-on-demand execution. If `npx` is unavoidable, specify an exact version and prevent automatic substitution with another release. 5. Remove instructions that automatically install the latest release. Upgrade only to an explicitly reviewed version. 6. Prefer the primary npm registry and require explicit user approval before switching registries. 7. Where compatible with the package, disable installation lifecycle scripts and enable only those specifically required after review. 8. Execute the CLI in a sandbox with access limited to the intended input images, output directory, required token, and required network endpoints. ]]>
