T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:79
- Finding
- Unpinned Third-Party CLI Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 79–82 and 98–100 **Vulnerability Type**: Supply-chain exposure through mutable npm dependencies **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` The surrounding instructions also permit on-demand execution: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade procedure explicitly installs the latest available release: ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill instructs the Agent to install and execute `@iqinghu/qhkit` without pinning an exact, audited version or enforcing package integrity through a lockfile. Both the unversioned package reference and `@latest` are mutable: their effective executable content can change after this Skill has been reviewed. The `npx` fallback can similarly retrieve and immediately run package code. A global npm installation increases the affected scope compared with a local, isolated installation and may run package lifecycle scripts during installation. This behavior is necessary only to the extent that the declared workflow requires the `qhkit` client. Automatic acquisition of an unpinned release, global installation, and unsolicited upgrades exceed the minimum-risk approach needed to provide that functionality. ### Attack Path 1. An attacker compromises the package publisher account, npm release process, registry path, or documented mirror. 2. The attacker publishes a malicious release under the legitimate package name. 3. An Agent follows the Skill and runs the unversioned, `@latest`, or `npx` command. 4. npm downloads the attacker-controlled release. 5. Installation lifecycle scripts or the invoked CLI execute with the Agent user's permissions. 6. Malicious code can access data and credentials available to that user and alter user-writable files. ### Impact Assessment Successful exploitation permits arbitrary code execution ...[truncated 499 chars]
- Remediation
- ## Remediation Suggestions - Pin `@iqinghu/qhkit` to a reviewed exact version rather than using an unversioned package reference or `@latest`. - Provide and enforce a lockfile containing npm integrity metadata. - Verify the package version and integrity before execution. - Prefer an isolated, project-local installation over global installation. - Avoid `npx` execution that implicitly downloads a mutable release. If `npx` is unavoidable, specify the exact reviewed version and disable interactive substitution. - Require informed user approval before installing or upgrading executable dependencies. - Perform upgrades only after reviewing the new version and its provenance. - Prefer the official npm registry; treat the fallback mirror as a separate trust dependency and apply equivalent integrity validation.
