T08 · Insecure Dependencies
Error
- Location
- SKILL.md:52
- Finding
- Unpinned Third-Party Packages Are Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:52`, `SKILL.md:78`, and `SKILL.md:91` **Vulnerability Type**: Unpinned executable dependencies and mutable package sources **Risk Level**: High ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple ``` ```bash npx --yes sharp-cli -i 原图 -o 压缩后.jpg resize 2048 ``` The instructions also permit npm packages to be retrieved through an alternative registry: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill instructs the agent to retrieve and execute third-party packages without pinning reviewed versions or verifying package integrity. In particular: - `@iqinghu/qhkit` is installed without an exact version. - `@iqinghu/qhkit@latest` deliberately resolves to mutable future content. - `npx --yes sharp-cli` retrieves and executes a package without interactive review. - Pillow and npm packages may be obtained from additional mirror infrastructure, expanding the supply-chain trust boundary. - No lockfile, package integrity value, signature verification, or vendored reviewed implementation is included in the project. Package installation normally executes package-controlled code, including installation hooks. The subsequently installed command-line programs also execute with the permissions of the agent account. This behavior is related to the declared functionality because `qhkit` is the service client, but automatic installation and mutable upgrades exceed the minimum privilege and trust necessary to use a preinstalled, reviewed client. The separate Node.js archive installation is not included in this finding. It pins Node.js to version `22.22.3` and checks the archive against the downloaded checksum manifest before extraction. The pre-scan characterization of line 61 as `curl | bash` is inaccurate: the remote data is piped to `grep` and `sha256sum ...[truncated 1328 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every executable dependency to an exact, reviewed version. 2. Provide and enforce lockfiles and registry integrity hashes where supported. 3. Remove automatic `@latest` upgrades and do not execute upgrade commands supplied dynamically by remote error messages without validation. 4. Avoid `npx --yes`; install a pinned, reviewed `sharp-cli` version or use an included local image-processing implementation. 5. Use trusted primary registries by default and require explicit user approval before switching to a mirror. 6. Verify package signatures or checksums independently of the package distribution channel where possible. 7. Require explicit user consent before installing or upgrading executable software. 8. Prefer a sandboxed, non-privileged environment with restricted filesystem, credential, and network access. ]]>
