T08 · Insecure Dependencies
Error
- Location
- SKILL.md:48
- Finding
- Unpinned Third-Party Packages Are Installed and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 48–51, 74–76, and 87 **Vulnerability Type**: Unpinned and insufficiently verified third-party dependencies **Risk Level**: High ### Complete Code Snippets ```bash npm i -g @iqinghu/qhkit ``` ```bash npx @iqinghu/qhkit <command> ... ``` ```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 source-image -o compressed-image.jpg resize 2048 ``` ### Technical Analysis The Skill instructs the Agent to download, install, and execute mutable third-party packages without pinning exact versions or validating package integrity. In particular: - `npm i -g @iqinghu/qhkit` resolves the package version at installation time. - `@latest` explicitly installs whichever release currently owns the mutable `latest` tag. - `npx` can download and immediately execute packages that are not already installed. - `pip install pillow` similarly resolves a mutable package release through a third-party mirror. - No lockfile, package digest, signature, provenance attestation, or independently verified checksum is provided for these dependencies. - Global installation is broader than necessary because it modifies the user's shared Node.js environment rather than an isolated project environment. Package installation can invoke package lifecycle scripts, and package execution grants the package access to the Agent's operating-system privileges. The documented registry mirrors expand the number of infrastructure providers that must be trusted. This behavior is related to the declared functionality because `qhkit` provides the video-generation interface and image-processing tools are used for compression. However, mutable global installation and immediate `npx` execution exceed the minimum privilege and supply-chain exposure necessary to provide that functionality. The separately flagged pipeline at lines 56–57 is not a `cu ...[truncated 1956 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every dependency to an exact reviewed version; do not use `@latest` or other mutable tags. 2. Commit a lockfile containing integrity metadata and install with deterministic commands such as `npm ci`. 3. Install dependencies in a dedicated project directory or isolated container rather than globally. 4. Avoid automatic `npx` downloads. Install a pinned package in advance and execute its local binary. 5. Pin Python packages with hashes and use an isolated virtual environment, for example through a hash-locked requirements file. 6. Use only trusted registries. If a mirror is required, apply the same package-integrity and provenance verification used for the primary registry. 7. Verify package signatures, npm provenance attestations, or independently published digests before execution. 8. Disable lifecycle scripts during installation where the package does not require them, and separately review any scripts that must run. 9. Run media-processing and service CLI dependencies in a sandbox with restricted filesystem access, network access, and environment variables. 10. Prefer an already provisioned, administrator-reviewed runtime instead of allowing a Skill to install executable dependencies dynamically. ]]>
