T08 · Insecure Dependencies
Error
- Location
- SKILL.md:40
- Finding
- Unpinned Third-Party Package Is Installed Globally<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 40–42 and 58–61 **Vulnerability Type**: Unpinned dependency installation and mutable supply-chain execution **Risk Level**: High ### Vulnerable Code Snippets ```bash npm i -g @iqinghu/qhkit ``` The instructions also recommend installing the latest available release: ```bash npm i -g @iqinghu/qhkit@latest ``` A third-party registry mirror may be selected with: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill directs the agent to install `@iqinghu/qhkit` without pinning an audited version or validating package integrity. The `@latest` upgrade command explicitly selects a mutable release whose contents may change after this Skill has been reviewed. An npm installation can execute package lifecycle scripts such as `preinstall`, `install`, and `postinstall`. Therefore, installing the package is not merely downloading a CLI: it can execute code with the privileges of the account running npm. Global installation also exposes the resulting executable broadly within that user's environment and exceeds the narrower scope of a temporary, task-specific installation. Using a fallback registry increases the number of supply-chain systems that must be trusted. The Skill does not require verification that the mirror returns the same package integrity metadata as the expected official release. ### Attack Path 1. An attacker compromises the npm publisher account, package release process, package dependencies, or configured registry. 2. The attacker publishes a malicious version under the expected package name or modifies a transitive dependency. 3. The agent follows the Skill and runs the unpinned global installation or the `@latest` upgrade command. 4. npm downloads the attacker-controlled release and may execute its lifecycle scripts during installation. 5. The malicious code runs with the privileges of the agent's operating-system account. 6. The installed ...[truncated 820 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specifically audited version rather than using an unversioned package name or `@latest`. 2. Record and verify npm integrity metadata or a trusted package digest before installation. 3. Remove the instruction to install upgrades merely because the package reports that an upgrade is available. 4. Require explicit user approval before installing or upgrading executable dependencies. 5. Prefer a task-scoped local installation in an isolated directory or container instead of a global installation. 6. Disable lifecycle scripts with `--ignore-scripts` if the package functions correctly without them. If scripts are required, audit those scripts and all relevant dependencies first. 7. Use the official npm registry by default. Treat registry fallback as an explicit trust decision and verify that the package digest matches the expected official artifact. 8. Execute the CLI as an unprivileged user with filesystem and network access restricted to the input video, output location, and required service endpoints. ]]>
