T08 · Insecure Dependencies
Error
- Location
- SKILL.md:49
- Finding
- Automatic Installation and Execution of Unpinned Third-Party Packages## Vulnerability Details **File Location**: `SKILL.md:49-55`, `SKILL.md:75-81`, and `SKILL.md:91` **Vulnerability Type**: Supply-chain exposure through mutable dependencies **Risk Level**: High ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npm i -g @iqinghu/qhkit@latest ``` The image-processing fallback also instructs the Agent to install or execute mutable packages using commands equivalent to: ```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 automatically installs and executes third-party packages without pinning reviewed versions or verifying package integrity. The explicit `@latest` upgrade is particularly unsafe because the code executed by the Skill can change after this audit without any change to `SKILL.md`. Global npm installation may run package lifecycle scripts and place executables in the global npm prefix. The `npx --yes` mechanism automatically downloads and executes a package without a separate approval step. The Python fallback similarly installs an unpinned package from a mirror. A compromised publisher account, registry, mirror, transitive dependency, or newly published malicious release could therefore introduce arbitrary code. Global installation exceeds the minimum privilege scope needed for a single Skill invocation. A project-local, version-pinned, isolated dependency would be sufficient. The instructions do not explicitly request root access, so this is not a confirmed privilege-escalation issue; malicious package code would execute with the existing Agent user's privileges. The separately flagged Node.js download at lines 60-61 is not a `curl | bash` command. It downloads a versioned archive and verifies it before extraction. However, when the mirror fallback is used, the archive and checksum can originate from the same mirror, which weakens ...[truncated 1388 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every dependency to an exact reviewed version; remove `@latest`. 2. Record and verify package integrity hashes or distribute dependencies through a controlled, authenticated artifact repository. 3. Use a project-local installation with a lockfile instead of global installation. 4. Run dependencies in an isolated, least-privilege environment with only the media files required for the task mounted. 5. Disable automatic `npx --yes` downloads. Install a pinned `sharp-cli` version through the same controlled dependency process. 6. Pin Pillow to a reviewed version and prefer the authenticated official index or an internally controlled mirror. 7. Require explicit user approval before installing or upgrading executable dependencies. 8. Disable unnecessary npm lifecycle scripts where compatible, and review the package and its transitive dependency tree before execution. 9. For Node.js bootstrap, pin the expected SHA-256 digest in the reviewed Skill or verify an official cryptographic signature. Do not obtain both the archive and its trust value solely from the same fallback mirror.
