T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:39
- Finding
- Unpinned Third-Party CLI Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 39–42 and line 60 **Vulnerability Type**: Unpinned dependency installation and unsafe supply-chain 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 directs the Agent to install and execute a mutable third-party npm package without specifying an exact audited version, lockfile, or integrity value. The `@latest` command explicitly selects whichever release is current at execution time. The `npx` fallback can download and immediately execute the package. npm installation may run package lifecycle scripts. A compromised package version, maintainer account, registry, or configured mirror could therefore introduce arbitrary executable code. Global installation also modifies the user's npm installation prefix and exposes the package to subsequent sessions, which exceeds the minimum necessary scope compared with an isolated, version-pinned installation. The reviewed project does not contain the package implementation, so the behavior ultimately executed by these commands cannot be established from the Skill itself. ### Attack Path 1. An attacker compromises the npm package, its publisher account, the registry, or a distribution mirror. 2. The attacker publishes a malicious version of `@iqinghu/qhkit`. 3. The Agent follows the Skill and runs the unpinned install, `@latest` upgrade, or `npx` command. 4. npm downloads the attacker-controlled release. 5. Malicious lifecycle scripts or CLI code execute with the permissions of the Agent's operating-system account. 6. The malicious package can access resources available to that account, including supplied media, the configured service token, and other user-readable files. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the privileges of the Age ...[truncated 485 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to an exact, reviewed version rather than using an unresolved version or `@latest`. 2. Record and verify npm integrity metadata for the approved package artifact. 3. Remove automatic `@latest` upgrades. Require explicit user approval and security review before changing versions. 4. Prefer an isolated project-local installation with a lockfile over global installation. 5. Avoid `npx` downloads that immediately execute unresolved packages. If `npx` is unavoidable, specify an exact version and use an approved registry. 6. Disable npm lifecycle scripts with `--ignore-scripts` where the package remains functional without them. 7. Run the dependency in a sandbox with access limited to the selected media, required network endpoints, and a narrowly scoped service token. 8. Do not expose unrelated files, credentials, or environment variables to the CLI process. ]]>
