T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:49
- Finding
- Execution of Unpinned Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:49-55`, `SKILL.md:76-79`, and `SKILL.md:89` **Vulnerability Type**: Unpinned and automatically executed third-party dependencies **Risk Level**: Medium ### Complete Code Snippet ```bash npm i -g @iqinghu/qhkit ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i 原图 -o 压缩后.jpg resize 2048 ``` The instructions also permit execution through `npx @iqinghu/qhkit <command> ...` when global installation fails. ### Technical Analysis The Skill directs the Agent to install and execute packages without pinning exact versions or verifying package integrity. In particular, `@latest`, `npx`, and unversioned `pip install` operations resolve package contents at execution time. The code that executes can therefore differ from the code available when the Skill was audited. NPM installation may execute package lifecycle scripts. Both `npx` and `npx --yes` can download and immediately run executable packages without a separate review step. Python package installation can likewise execute build-system code or package setup logic. Use of alternative registries and mirrors further expands the set of infrastructure that must be trusted. Global installation of `@iqinghu/qhkit` is broader than necessary for a single video-generation task. It modifies the user-level or system-level Node.js environment and may affect later projects or sessions. The separately flagged Node.js checksum command at `SKILL.md:60` is not itself a `curl | bash` execution pattern: ```bash cd /tmp && curl -fsSL https://nodejs.org/dist/v22.22.3/SHASUMS256.txt | grep ' node-v22.22.3-linux-x64.tar.xz$' | sha256sum -c - ``` It sends checksum data to `sha256sum`, not to a shell, and the instructions require successful verification before extraction. The primary supply-chain risk comes from the subsequently installed, unpinned packages. ### Attack Path 1. A ...[truncated 1500 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every dependency to a reviewed exact version, for example: ```bash npm install --no-save --ignore-scripts @iqinghu/qhkit@<reviewed-version> python -m pip install pillow==<reviewed-version> ``` 2. Record and verify package integrity hashes. Use an NPM lockfile with integrity metadata and Python hashes through `pip --require-hashes`. 3. Remove `@latest` and avoid automatic upgrades in response to remote messages. Present upgrade information to the user and require explicit approval. 4. Avoid `npx --yes` because it combines download and execution without review. Install reviewed packages into a dedicated, isolated environment first. 5. Prefer a project-local installation, temporary container, virtual environment, or other sandbox instead of global installation. 6. Disable package lifecycle scripts where compatible, and review any scripts that must remain enabled. 7. Restrict registry use to explicitly approved sources. Do not silently switch to a mirror. 8. Require informed user approval before installing software or changing the global environment. 9. Run dependency tools with restricted filesystem and network access and without unrelated credentials in the environment. ]]>
