T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:51
- Finding
- Unpinned Third-Party Packages Are Installed and Executed Automatically<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:51-54`, `SKILL.md:78-81`, and `SKILL.md:91` **Vulnerability Type**: Unpinned dependency installation and supply-chain code execution **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npm i -g @iqinghu/qhkit@latest ``` The image-processing fallback also directs the Agent to install or execute additional unpinned packages: ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli ``` ### Technical Analysis The Skill instructs the Agent to retrieve and execute third-party packages without pinning reviewed versions or package integrity hashes. In particular, `@latest` explicitly selects whichever package release is current when the command runs. The effective executable code can therefore change after the Skill itself has been reviewed. Global npm installation may execute package lifecycle scripts and places executables in a shared user or system-level npm prefix. The `npx --yes` fallback downloads and executes a package without interactive confirmation. The instructions also permit alternative npm and Python mirrors, increasing the number of supply-chain systems that must be trusted. This behavior is related to the declared functionality because the Skill requires the `qhkit` client. However, automatic global installation, automatic upgrades to `@latest`, and execution of unpinned auxiliary packages exceed the minimum-risk installation strategy. A project-local, version-pinned, integrity-verified installation would provide the necessary functionality with less exposure. The separately flagged checksum pipeline at `SKILL.md:60` is not a `curl | bash` execution: ```bash curl -fsSL https://nodejs.org/dist/v22.22.3/SHASUMS256.txt | grep ' node-v22.22.3-linux-x64.tar.xz$' | sha256sum -c - ``` It passes a checksum record to `sha256sum`, not executable shell code, and the archive is extracted only after verification. Consequ ...[truncated 1530 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every executable dependency to a reviewed exact version rather than using an implicit current version or `@latest`. 2. Use lockfiles and registry-supported integrity metadata. Where practical, independently record and verify expected package hashes. 3. Install packages in an isolated project directory or disposable container instead of globally. 4. Disable unnecessary npm lifecycle scripts during installation and review any lifecycle scripts required by the package before enabling them. 5. Replace automatic `npx --yes` execution with a pinned, preinstalled tool or an explicitly approved local dependency. 6. Avoid automatically switching to third-party mirrors. If a mirror is necessary, use an approved mirror with equivalent integrity verification and document its trust assumptions. 7. Require explicit user approval before installing or upgrading executable dependencies. 8. Run media-processing and CLI dependencies in a sandbox with limited filesystem access, restricted network access, and only the credentials required for the current operation. 9. Maintain a reviewed version allowlist and update it through a controlled security review rather than executing upgrade commands supplied dynamically by package output. ]]>
