T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:44
- Finding
- Unpinned Third-Party Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 44–65 **Vulnerability Type**: Unpinned and mutable npm dependency execution **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npx @iqinghu/qhkit <command> ... ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill instructs the Agent to install and execute `@iqinghu/qhkit` without pinning an audited version or package integrity value. It also recommends upgrading to the mutable `latest` release. Consequently, the code executed at installation or invocation time can differ from the code that existed when this Skill was reviewed. npm packages may run lifecycle scripts during installation, and the installed CLI executes with the permissions of the invoking account. The instructions additionally permit using a third-party npm mirror as a fallback, increasing the number of supply-chain systems that must remain trustworthy. A global installation is broader than necessary for executing one video-generation tool. Depending on the npm configuration and invoking environment, it may modify a user-wide or system-wide package location. If installation is performed through an elevated shell, package scripts inherit those elevated privileges. ### Attack Path 1. An attacker compromises the package publisher account, an upstream dependency, npm distribution infrastructure, or the permitted mirror. 2. The attacker publishes a malicious release under the legitimate package name or compromises a transitive dependency. 3. The Agent runs the unpinned global installation, the `latest` upgrade, or `npx` invocation. 4. npm downloads the attacker-controlled version and may execute its lifecycle scripts. 5. The installed CLI subsequently executes attacker-controlled code under the Agent's operating-system account. 6. That code can access files, environment variables, credentials, media assets, and network resources available to that account. ## ...[truncated 634 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specific audited version rather than using an implicit current version or `@latest`. 2. Verify the package using a trusted integrity digest, signed provenance, or a checked-in lockfile. 3. Avoid global installation. Use a dedicated, non-privileged project directory or isolated container with a minimal filesystem and network scope. 4. Do not invoke `npx` without a pinned version; prevent it from silently downloading a mutable release. 5. Review package lifecycle scripts and use `--ignore-scripts` where compatible with legitimate functionality. 6. Do not execute upgrade commands copied from package-controlled output without validating them against a fixed allowlist. 7. Prefer the official npm registry. If a mirror is required, independently verify package integrity against trusted metadata. 8. Never perform the installation with administrator or root privileges unless a documented and unavoidable requirement exists. ]]>
