T08 · Insecure Dependencies
Error
- Location
- SKILL.md:52
- Finding
- Runtime Installation and Execution of Mutable Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:52-55`, `SKILL.md:78-80`, and `SKILL.md:91` **Vulnerability Type**: Supply-chain exposure through unpinned runtime dependencies **Risk Level**: High ### Complete Code Snippet ```bash npm i -g @iqinghu/qhkit ``` ```text The default source is the official npm registry. If it is slow or unavailable, add: --registry=https://registry.npmmirror.com If global installation fails because of permissions and privilege elevation is unavailable, use: npx @iqinghu/qhkit <command> ... ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i <input-path> -o <output-path>.jpg resize 2048 ``` ### Technical Analysis The Skill instructs the Agent to install and execute packages dynamically from npm and Python package registries. The primary package is installed without an exact version, while the upgrade procedure explicitly requests `@latest`. The image-compression fallback similarly installs or executes mutable versions of Pillow and `sharp-cli`. These packages and their transitive dependencies are not included in the audited project. Their executable content can therefore change independently after this Skill has been reviewed. Use of alternate mirrors creates additional infrastructure that must be trusted. The `npx --yes` command is particularly sensitive because it can download and execute a package without an interactive confirmation. The global installation of `@iqinghu/qhkit` also has broader scope than is strictly necessary for a single Skill invocation. Although the instructions do not explicitly require root access, a global package can modify shared executable locations when the current account has sufficient permissions. The checksum operation at `SKILL.md:61` is not a `curl | bash` execution. It pipes a remotely retrieved checksum manifest through `grep` and `sha256sum`, and the archive is only extracted after v ...[truncated 1181 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every package to a reviewed, exact version rather than using unversioned packages or `@latest`. 2. Verify package integrity with lockfiles, npm integrity metadata, hashes, or signed release artifacts. 3. Remove automatic upgrades based solely on CLI or server-provided messages. Require explicit user approval after displaying the exact target version and source. 4. Avoid global installations. Install dependencies in a dedicated, unprivileged project directory or isolated container. 5. Replace `npx --yes` with a preinstalled, version-pinned utility. 6. Use one trusted registry wherever possible. If a mirror is required, document its trust assumptions and verify fetched artifacts against hashes obtained through an independent trusted channel. 7. Disable unnecessary package lifecycle scripts during installation where compatible, and review required scripts before enabling them. 8. Run external media tooling in a sandbox with limited filesystem and network access. ]]>
