T08 · Insecure Dependencies
Error
- Location
- SKILL.md:42
- Finding
- Unpinned Third-Party Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 42-63 **Vulnerability Type**: Unpinned and automatically upgraded npm dependency **Risk Level**: High ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npx @iqinghu/qhkit <command> ... ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The instructions install and execute `@iqinghu/qhkit` without pinning it to an audited version or package integrity hash. The explicit `@latest` upgrade further allows package contents to change after this Skill has been reviewed. npm packages can contain executable lifecycle scripts, and the installed CLI itself runs arbitrary package code. The package therefore receives the privileges of the user running npm or `npx`. The optional fallback to a third-party npm mirror also expands the supply-chain trust boundary. This dependency is relevant to the declared image-editing function, but automatically installing an unpinned package is not the minimum-risk way to provide that function. The Skill should use a reviewed, immutable dependency version and obtain approval before changing installed software. ### Attack Path 1. An attacker compromises the npm package, a maintainer account, a release process, or a configured registry response. 2. The attacker publishes a malicious version under the expected package name or version channel. 3. The Agent follows the Skill instructions and runs the unpinned global installation, `npx`, or `@latest` upgrade. 4. npm executes malicious lifecycle code or installs the malicious CLI. 5. The package executes with the Agent user's privileges and can access resources available to that account. ### Impact Assessment Successful exploitation provides arbitrary code execution with the privileges of the account running npm. This can expose local files, environment variables, API credentials, image inputs, and other data available to the Agent. A global installation may also modify the user's npm ...[truncated 296 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin `@iqinghu/qhkit` to a specific, reviewed version instead of using a bare package reference or `@latest`. - Verify the package with an independently maintained integrity hash, lockfile, or signed provenance information. - Remove the instruction to execute upgrades supplied dynamically by version channels. - Require explicit user approval before installing or upgrading software. - Prefer execution in a restricted environment with minimal filesystem and credential access. - Avoid global installation when a project-local, locked dependency is sufficient. - Disable npm lifecycle scripts where compatible, such as with `--ignore-scripts`, and separately review any required installation scripts. - Treat alternate registries as separate trust boundaries and require equivalent integrity verification. ]]>
