T08 · Insecure Dependencies
Error
- Location
- SKILL.md:36
- Finding
- Automatic Installation and Execution of Unpinned npm Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:36`, `SKILL.md:39`, and `SKILL.md:56` **Vulnerability Type**: Supply-chain exposure through mutable third-party dependencies **Risk Level**: High ### Vulnerable Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The fallback instructions also permit direct execution through `npx`: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade procedure explicitly retrieves the latest available release: ```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 directs the Agent to upgrade to the mutable `latest` release in response to version messages produced by the installed CLI. An npm installation can execute package lifecycle scripts, while subsequent CLI invocations execute the package's local code. Therefore, the effective executable payload is controlled by whichever package version the registry resolves at installation time, rather than by code contained in the reviewed Skill. Global installation unnecessarily broadens the modification scope compared with a project-local or isolated installation. The reviewed repository contains only `SKILL.md`; it does not contain the npm package implementation or a lockfile. Consequently, the package's runtime behavior, upload destinations, lifecycle scripts, and integrity cannot be established from the audited artifact. There is no evidence that the current package is malicious, but the installation design creates a concrete supply-chain trust boundary and unsafe automatic-update path. The documented Node archive flow is not a `curl | bash` pattern. It downloads an archive and checks it with `sha256sum` before extraction. That flow does not constitute direct remote-script execution, although using a fallback mirror for both the archive and checksum provides weaker provenance than verification against an in ...[truncated 1445 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to an exact reviewed version rather than an implicit current version or `@latest`. 2. Use a lockfile and enforce the expected npm integrity hash. Verify package provenance before execution. 3. Remove automatic upgrade instructions based solely on messages emitted by the installed CLI. Require explicit review and approval of each new version. 4. Prefer a project-local, temporary, or sandboxed installation over `npm i -g`. 5. Run the dependency under a dedicated low-privilege account or isolated container with access only to the media selected for processing. 6. Restrict filesystem and network access to the minimum destinations and files required for the operation. 7. Consider disabling npm lifecycle scripts where compatible, for example with `--ignore-scripts`, and separately verify that the package does not depend on them. 8. Document the exact expected service endpoints and package publisher identity so unexpected network destinations or ownership changes can be rejected. ]]>
