T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:51
- Finding
- Unpinned Third-Party Packages Are Installed and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:51-54, 77-79, 90` **Vulnerability Type**: Supply-chain exposure through mutable dependencies **Risk Level**: Medium ### Complete Relevant Snippets ```bash npm i -g @iqinghu/qhkit ``` ```text If the official registry is slow or times out, add: --registry=https://registry.npmmirror.com If global installation fails because of permissions, use: npx @iqinghu/qhkit <command> ... ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i original-image -o compressed-image.jpg resize 2048 ``` ### Technical Analysis The Skill instructs the agent to install or execute third-party packages without pinning exact versions or verifying package integrity. The use of `@latest`, omitted versions, and `npx --yes` permits the executed package content to change after the Skill has been reviewed. The fallback use of npm and pip mirrors broadens the set of infrastructure that must be trusted. Global installation of `@iqinghu/qhkit` also modifies the user's environment beyond the immediate video-generation task. Package installation is relevant to the declared functionality, but mutable global installation and unattended `npx` execution exceed the safest minimum required. Unlike the separately flagged Node.js archive download, these package operations do not include a checksum or other integrity verification. ### Attack Path 1. An attacker compromises a package publisher account, package release, registry, mirror, or dependency in the package tree. 2. The agent installs the mutable package version through npm or pip, or executes it directly through `npx --yes`. 3. Package lifecycle scripts or runtime code execute with the privileges of the agent's operating-system account. 4. The malicious package reads accessible files, API credentials, media assets, or environment variables. 5. The package may transmit the collected informatio ...[truncated 750 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every dependency to a reviewed exact version; do not use `@latest` or omitted versions. 2. Use a lockfile and verified package integrity hashes where supported. 3. Replace `npx --yes` with a locally installed, pinned executable. 4. Prefer a project-local installation instead of global npm installation. 5. Require explicit user approval before installing or upgrading packages. 6. Use primary registries by default. Only use a mirror after explicit user approval and document the additional trust boundary. 7. Run dependency installation and media processing in a restricted sandbox with access only to required files. 8. Disable unnecessary npm lifecycle scripts where compatible, for example by using `--ignore-scripts`, and enable them only after review when required. 9. Maintain an allowlist of approved package names, versions, registries, and integrity values. ]]>
