T08 · Insecure Dependencies
Error
- Location
- SKILL.md:54
- Finding
- Unpinned Third-Party Packages Are Installed and Executed at Runtime<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 54-57; line 80; line 93 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: High ### Vulnerable Code Snippets ```bash npm i -g @iqinghu/qhkit ``` ```bash npm i -g @iqinghu/qhkit@latest ``` The Skill also directs the agent to use runtime package execution and installation mechanisms: ```bash npx @iqinghu/qhkit <command> ... ``` ```bash npx --yes sharp-cli ... ``` ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple ``` ### Technical Analysis The Skill installs or directly executes third-party packages without pinning their versions or validating their package artifacts against trusted integrity values. In particular, `@latest` explicitly resolves to whatever release the package publisher currently designates, while `npx --yes` can download and execute a package without an additional confirmation step. This creates a time-of-review/time-of-execution gap: the code executed when the Skill is invoked may differ from the code that existed during this audit. npm lifecycle scripts and package entry points can execute arbitrary commands with the permissions of the agent process. The optional npm and Python mirrors introduce additional supply-chain trust boundaries. Global npm installation is broader than necessary for a single image-generation task. It modifies the user's shared tool environment and may affect subsequent sessions or other applications using the same command name. ### Attack Path 1. An attacker compromises a package publisher account, package repository, release pipeline, or configured package mirror. 2. The attacker publishes a malicious release of `@iqinghu/qhkit`, `sharp-cli`, Pillow, or a transitive dependency. 3. The agent follows the Skill's bootstrap or upgrade instructions. 4. npm, npx, or pip resolves and downloads the attacker-controlled package version. 5. Package lifecycle scripts or runtime entry points execute with the agen ...[truncated 1093 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every dependency to an audited exact version rather than using unversioned packages or `@latest`. 2. Verify downloaded package artifacts using trusted integrity hashes, signed provenance, or registry signatures. 3. Use a project-local installation with a lockfile instead of global installation. 4. Run third-party tooling in an isolated container or sandbox with restricted filesystem and network access. 5. Disable or tightly control package lifecycle scripts where operationally possible. 6. Do not use `npx --yes` for packages that have not already been pinned and verified. 7. Require explicit user approval before installing or upgrading executable dependencies. 8. Avoid switching registries automatically. If a mirror is necessary, document its trust assumptions and verify artifacts independently. 9. Separate image processing into a preinstalled, reviewed component rather than downloading image-processing tools during a task. 10. Replace automatic upgrade instructions with a controlled process that reviews and pins each new version before deployment. ]]>
