T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:57
- Finding
- Unpinned Global Installation and Execution of the qhkit Package## Vulnerability Details **File Location**: `SKILL.md`, lines 57–83 **Vulnerability Type**: Unpinned third-party dependency installation and execution **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` The instructions also permit on-demand execution through `npx` and later direct installation of the mutable latest release: ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill directs the Agent to globally install `@iqinghu/qhkit` without an exact version or independently verified integrity value. It also recommends upgrading to `@latest` and permits execution through `npx`. These installation methods resolve package contents dynamically at execution time, meaning the code executed by the Agent can differ from the code available when the Skill was audited. Global installation broadens the effect of a dependency compromise because the package and its executable are placed in a user-wide or system-wide command location. If installation is performed with elevated permissions, the package lifecycle scripts could execute with those elevated privileges. Even without elevation, package code runs with the Agent user's access to local files, environment variables, network resources, and configured credentials. Registry mirror fallback further increases the number of supply-chain trust points. No evidence shows that the named package or mirrors are currently malicious; the vulnerability is the lack of immutable version and integrity controls. ### Attack Path 1. An attacker compromises the package maintainer account, package registry, mirror, or a transitive dependency. 2. The attacker publishes a malicious version under the legitimate package name or causes mutable package resolution to return compromised content. 3. The Agent follows the Skill's bootstrap or upgrade instructions and runs the unpinned global installation, `@latest` installation, or `npx` execution. 4. Packa ...[truncated 1160 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a reviewed exact version rather than using an implicit current release or `@latest`. 2. Record and verify the expected npm integrity digest before installation. 3. Use a lockfile or equivalent mechanism to pin the complete transitive dependency tree. 4. Remove automatic upgrade instructions. Require explicit review before changing the installed version. 5. Avoid global installation. Install the package in a dedicated, non-privileged project directory or isolated container. 6. Do not run package installation with `sudo`, administrator rights, or an account holding unrelated secrets. 7. Replace unrestricted `npx` execution with a pinned package version and integrity-verified local executable. 8. Prefer the canonical registry. If a mirror is necessary, require a trusted mirror and verify package integrity against metadata obtained through an independent trusted channel. 9. Run the image-generation client with access limited to only the input files and credentials required for the current task.
