T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:44
- Finding
- Unpinned Third-Party CLI Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 44–50; additional upgrade instruction at lines 71–75 **Vulnerability Type**: Untrusted and mutable third-party dependency execution **Risk Level**: Medium ```bash npm i -g @iqinghu/qhkit ``` The surrounding instructions also allow execution through `npx @iqinghu/qhkit` and later recommend installing `@iqinghu/qhkit@latest`. ### Technical Analysis The Skill instructs the Agent to install and execute a third-party npm package whose implementation is not included in the audited artifact. The requested package version is not pinned, and the upgrade procedure explicitly selects the mutable `latest` release. Consequently, the code executed during one invocation may differ from the code available when the Skill was reviewed. Global npm installation can execute package lifecycle scripts and installs executable commands into the user's global npm environment. The documented `npx` fallback can also download and immediately execute the package. Use of the alternate `registry.npmmirror.com` registry increases the number of supply-chain systems that must be trusted. This behavior supports the declared media-processing functionality, but automatic installation and execution of mutable third-party code exceed the minimum risk necessary when compared with a pinned, integrity-verified dependency. ### Attack Path 1. An attacker compromises the npm package, a package maintainer account, a registry, or a newly published package release. 2. The compromised release is assigned the selected version or the `latest` tag. 3. The Agent follows the Skill instructions and runs the global npm installation, upgrade, or `npx` fallback. 4. npm lifecycle scripts or the installed CLI execute attacker-controlled code locally. 5. The malicious code operates with the privileges of the user running the Agent and may access files, environment variables, network resources, and credentials available t ...[truncated 482 chars]
- Remediation
- ## Remediation Suggestions - Pin `@iqinghu/qhkit` to a specifically reviewed version instead of using an implicit current version or `@latest`. - Verify package integrity using a lockfile, npm integrity metadata, or a separately authenticated checksum. - Remove automatic upgrade instructions and require explicit user approval before changing the installed version. - Avoid `npx` download-and-execute behavior unless the exact version and integrity are specified. - Prefer a project-local installation in an isolated environment rather than modifying the user's global npm environment. - Disable npm lifecycle scripts where compatible with the package and verify that the CLI still functions correctly. - Require explicit confirmation before installation and disclose that third-party code will execute with the user's privileges. - Vet each permitted registry and avoid silently switching dependency sources.
