T08 · Insecure Dependencies
Error
- Location
- SKILL.md:42
- Finding
- Unpinned Third-Party CLI Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 42-45 and 63 **Vulnerability Type**: Uncontrolled third-party executable 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 Skill instructs the Agent to install and execute `@iqinghu/qhkit` without pinning an audited version or package integrity value. It also explicitly recommends installing the `latest` release during upgrades and permits package retrieval through a third-party npm mirror. npm packages contain executable JavaScript and may define lifecycle scripts that run during installation. Global installation makes the package available throughout the Agent user's environment. The behavior of an unpinned package can change after this Skill has been audited, so reviewing `SKILL.md` does not establish the safety of the code that will eventually execute. Use of `npx` does not eliminate this risk because it can download and immediately execute the currently resolved package version. ### Attack Path 1. An attacker compromises the package publisher account, npm package, registry infrastructure, or configured mirror. 2. The attacker publishes or serves a malicious release under the expected package name. 3. The Agent follows the bootstrap or upgrade instructions and runs the unpinned global installation, `npx`, or `@latest` command. 4. Malicious package lifecycle scripts or CLI code execute as the Agent's operating-system user. 5. The payload can access data and credentials available to that user, modify user-owned files, and make outbound network requests. ### Impact Assessment Successful exploitation provides arbitrary code execution with the privileges of the account running npm or `npx`. This can expose local files, environment variables, API credentials, generated assets, and other ...[truncated 406 chars]
- Remediation
- ## Remediation Suggestions - Pin `@iqinghu/qhkit` to a specific audited version rather than relying on the registry default or `@latest`. - Verify the package tarball against a separately maintained integrity hash or signed provenance record. - Use a lockfile, trusted internal artifact repository, or reviewed vendored artifact. - Avoid global installation; install the dependency in an isolated, least-privileged project directory or container. - Avoid using `npx` for automatic retrieval and immediate execution of unreviewed versions. - Disable npm lifecycle scripts with `--ignore-scripts` where compatible, then explicitly run only reviewed setup operations. - Require explicit user approval before installing or upgrading executable dependencies. - Treat mirror fallback as a distinct trust decision and verify that mirror-delivered artifacts match the approved package integrity.
