T08 · Insecure Dependencies
Error
- Location
- SKILL.md:51
- Finding
- Runtime Installation and Execution of Mutable Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:51-54`, `SKILL.md:77-80`, and `SKILL.md:90` **Vulnerability Type**: Unsafe runtime dependency installation and supply-chain exposure **Risk Level**: High ### Complete Code Snippets ```bash npm i -g @iqinghu/qhkit ``` The accompanying instructions permit fallback to a mirror and execution through `npx`: ```text Default to the official npm registry; if it is slow or times out, add --registry=https://registry.npmmirror.com. Only when global installation fails because of permissions and privilege elevation is unavailable, fall back to npx @iqinghu/qhkit <command> ... ``` The upgrade procedure installs the most recently published version without pinning it: ```bash npm i -g @iqinghu/qhkit@latest ``` Image-processing dependencies may also be installed or executed dynamically: ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i source-image -o compressed-image.jpg resize 2048 ``` ### Technical Analysis The Skill directs the Agent to retrieve and execute third-party packages at runtime. The primary CLI is globally installed without an exact version or integrity constraint, while the upgrade procedure explicitly selects `@latest`. The `npx --yes` fallback can download and execute the currently resolved package without interactive review. Package installation can execute package lifecycle hooks and subsequently runs the installed application with the Agent user's permissions. Because the effective package contents are resolved after the Skill has been reviewed, a compromised publisher account, malicious package release, registry compromise, or dependency-chain compromise could change the code that is executed. Use of alternate npm and Python registries expands the supply-chain trust boundary. The required video-generation CLI is legitimate to the declared functionality, but automatically installing mutable packages, globally where possible, exceeds the min ...[truncated 1864 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every dependency to a specific reviewed version rather than using an unconstrained package name or `@latest`. 2. Verify package integrity using lockfiles, npm integrity metadata, hashes, or signed release artifacts. 3. Remove automatic `npx --yes` execution. Require explicit user approval before downloading or executing a package that is not already installed. 4. Avoid global installation. Install dependencies into a dedicated, non-privileged project directory or isolated container. 5. Prefer a prebuilt, reviewed runtime image containing fixed versions of Node.js, `qhkit`, Pillow, and image-processing tools. 6. Pin and audit transitive dependencies, and monitor package ownership and release changes. 7. Minimize registry switching. If mirrors are required, document their trust model and validate retrieved artifacts against hashes obtained through an independent trusted channel. 8. Run the CLI with restricted filesystem and network access, exposing only the media files and service endpoints required for the requested operation. 9. Require explicit user confirmation before any environment modification, separate from confirmation of paid video generation. ]]>
