T08 · Insecure Dependencies
Error
- Location
- SKILL.md:44
- Finding
- Unpinned Third-Party Package Is Installed and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 44–47 **Vulnerability Type**: Unpinned executable dependency and unsafe package installation **Risk Level**: High ### Evidence ```bash npm i -g @iqinghu/qhkit ``` The instructions also provide this fallback: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade procedure at line 64 similarly installs a mutable release: ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill installs and executes the third-party `@iqinghu/qhkit` npm package without pinning it to a reviewed version or verifying package integrity. A global npm installation can execute package lifecycle scripts and place executable files in a shared command path. The `npx` fallback can download and immediately execute the package. The package implementation is not included in the audited project, so its behavior could not be reviewed. Using the mutable `latest` release also allows the effective executable code to change after this Skill has been audited. The optional registry mirror introduces an additional supply-chain trust point. Installing the CLI is related to the declared image-generation function, but global installation exceeds the minimum scope necessary. A project-local, pinned, integrity-checked, and sandboxed installation would provide the required functionality with less risk. ### Attack Path 1. An attacker compromises the npm publisher account, registry distribution path, configured mirror, or a future package release. 2. The attacker publishes a malicious version of `@iqinghu/qhkit`. 3. The Agent follows the bootstrap or upgrade instructions. 4. `npm -g` or `npx` downloads the mutable malicious version. 5. npm lifecycle scripts or the installed `qhkit` executable run attacker-controlled code. 6. The code operates with the privileges of the Agent process and can access resources available to that account. ### Impact Assessment Successful exploitation could provide arbitrary code ...[truncated 582 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to an exact version that has been independently reviewed. 2. Verify the package with a committed lockfile and npm integrity metadata. 3. Do not use `@latest` in automated Skill instructions. 4. Install the dependency into a dedicated project directory rather than globally. 5. Run the CLI in a sandbox or container with access limited to explicitly selected image files. 6. Restrict filesystem and network access to the minimum needed for the image-generation service. 7. Disable npm lifecycle scripts during installation where compatible, and review any required scripts separately. 8. Treat registry mirrors as distinct trust boundaries and permit only approved, authenticated registries. 9. Require explicit user approval before installing or upgrading executable dependencies. ]]>
