T08 · Insecure Dependencies
Error
- Location
- SKILL.md:48
- Finding
- Runtime Installation and Execution of Mutable Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:48-65`, `SKILL.md:80`, and `SKILL.md:93` **Vulnerability Type**: Supply-chain exposure through runtime package installation **Risk Level**: High ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npm i -g @iqinghu/qhkit@latest ``` The fallback image-processing workflow additionally installs or executes dependencies dynamically: ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i INPUT_FILE -o OUTPUT_FILE.jpg resize 2048 ``` ### Technical Analysis The Skill directs the Agent to install and execute third-party software at runtime. The primary `qhkit` package is installed globally, while the upgrade workflow explicitly uses the mutable `@latest` tag. The Pillow installation is not version-pinned, and `npx --yes sharp-cli` can download and immediately execute a package without interactive review. This design prevents the audited `SKILL.md` file from defining the complete executable behavior of the Skill. Package contents can change after the Skill has been reviewed. Package lifecycle scripts and subsequently invoked CLI code execute with the permissions of the Agent process. The optional use of alternate npm and Python package mirrors adds further supply-chain trust boundaries. No evidence establishes that these packages or mirrors are malicious, but the installation mechanism leaves the Skill exposed to package-account compromise, malicious updates, registry compromise, and dependency substitution. ### Attack Path 1. An attacker compromises a referenced package, package maintainer account, registry, mirror, or transitive dependency. 2. The attacker publishes a malicious package version under the expected package name. 3. The Agent follows the environment bootstrap or upgrade instructions. 4. An unpinned command such as `@latest`, `pip install pillow`, or `npx --yes sharp-cli` retrieves the attacker-controlled release. 5. Installation lif ...[truncated 1179 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every dependency to a reviewed, exact version; do not use `@latest` or unconstrained package versions. 2. Verify package artifacts against integrity hashes maintained within a trusted lockfile or signed release manifest. 3. Replace global installation with a project-local installation inside a dedicated, restricted environment. 4. Disable or carefully review package lifecycle scripts where operationally possible. 5. Vendor or prepackage the audited CLI implementation so installation is not performed during Skill invocation. 6. Pin Pillow and `sharp-cli`, including their transitive dependency trees, through lockfiles. 7. Avoid automatic `npx --yes` execution. Install the reviewed package first, verify its integrity, and invoke the pinned local binary. 8. Use official registries by default. If mirrors are required, apply the same artifact-integrity verification rather than trusting the mirror-provided package or checksum alone. 9. Run image processing and remote CLI operations in a sandbox with minimal filesystem access, restricted environment variables, and outbound-network controls. 10. Require explicit user approval before installing or upgrading executable dependencies. ]]>
