T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:54
- Finding
- Mutable Third-Party Packages Are Installed and Executed Without Version Pinning## Vulnerability Details **File Location**: `SKILL.md`, lines 54–57; related installation paths also appear at lines 80–83 and 93 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` The accompanying instructions allow a fallback to: ```bash npx @iqinghu/qhkit <command> ... ``` Other mutable dependency installation or execution paths include: ```bash npm i -g @iqinghu/qhkit@latest 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 instructs the Agent to globally install an unpinned npm package. It also permits packages to be fetched and immediately executed through `npx`, including use of `--yes`, which suppresses an interactive confirmation. The upgrade workflow explicitly selects the mutable `latest` release. These practices make the code ultimately executed by the Skill dependent on package-registry state at invocation time rather than on a reviewed and reproducible dependency set. Package installation can execute package lifecycle scripts, while the installed CLI can execute arbitrary code with the permissions of the Agent process. The fallback mirrors add further trusted infrastructure. The audit found no evidence that the named packages or mirrors are currently malicious; the vulnerability is the unsafe, mutable supply-chain execution model. Global installation also exceeds the minimum privileges necessary for this image-generation workflow. A pinned, project-local or isolated installation would be sufficient. ### Attack Path 1. An attacker compromises a package maintainer account, package release process, registry, mirror, or transitive dependency. 2. The attacker publishes a malicious release under the expected package name or modifies a dependency selected by an unpinned installation. ...[truncated 918 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every dependency to a reviewed exact version rather than using an implicit current version or `@latest`. 2. Record dependency integrity values in a lockfile and verify them before installation. 3. Install dependencies locally in a dedicated project directory or disposable sandbox instead of globally. 4. Avoid dynamically fetching and executing packages through `npx`. Preinstall and invoke a reviewed, pinned binary. 5. Disable package lifecycle scripts where compatible, for example through npm's `--ignore-scripts` option, and separately review any required installation scripts. 6. Use one explicitly approved registry. If mirrors are necessary, document their trust model and require equivalent integrity verification. 7. Run image processing and CLI operations in a restricted environment with access only to the required input and output files. 8. Require explicit user approval before installing or upgrading executable dependencies.
