T08 · Insecure Dependencies
Error
- Location
- SKILL.md:54
- Finding
- Unpinned Third-Party Packages Are Installed and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:54-57`, `SKILL.md:80-83`, and `SKILL.md:93` **Vulnerability Type**: Unpinned executable dependencies and unsafe supply-chain sources **Risk Level**: High ### Complete Code Snippets ```bash npm i -g @iqinghu/qhkit ``` The instructions also permit execution through `npx` and a third-party npm mirror: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade procedure explicitly installs the mutable latest release: ```bash npm i -g @iqinghu/qhkit@latest ``` Image processing may install or execute additional unpinned packages: ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i ORIGINAL_IMAGE -o COMPRESSED_IMAGE.jpg resize 2048 ``` ### Technical Analysis The Skill directs the Agent to download and execute mutable third-party packages without pinning exact versions or verifying package integrity. The global installation of `@iqinghu/qhkit` is especially sensitive because npm installation lifecycle scripts execute with the privileges of the invoking account and the resulting executable becomes available system-wide for that user or environment. Installing `@latest` guarantees that the effective executable can change after this Skill has been reviewed. Likewise, `npx --yes sharp-cli` automatically downloads and executes a package without an interactive trust decision. The Pillow installation uses a third-party Python package mirror rather than the canonical package index. These behaviors are broader than the minimum privileges required to generate an image. A safer implementation would use a preinstalled, reviewed CLI or an exact dependency version installed into an isolated environment. No evidence establishes that the named packages are currently malicious; the vulnerability is the mutable and insufficiently verified supply-chain execution path. The separate Node download at lines 62-63 is not a `curl | bash` execution chain. It downloads an archive a ...[truncated 1566 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every package to an exact reviewed version, including `@iqinghu/qhkit`, `sharp-cli`, and Pillow. 2. Remove `@latest` upgrades and require review before changing dependency versions. 3. Use lockfiles and verify registry-provided integrity metadata or independently published cryptographic hashes. 4. Prefer official registries. Do not silently fall back to third-party mirrors; require explicit user approval and document the trust implications. 5. Install dependencies into an isolated project directory, virtual environment, or disposable container instead of using global installation. 6. Disable package lifecycle scripts where feasible, for example with `npm install --ignore-scripts`, after confirming that the package operates correctly without them. 7. Replace `npx --yes` with a pinned, locally installed executable. 8. Require explicit user confirmation before downloading or installing executable software. 9. Run image-processing tools in a sandbox with restricted filesystem, environment, and network access. ]]>
