T08 · Insecure Dependencies
Error
- Location
- SKILL.md:38
- Finding
- Unpinned Third-Party Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:38-44` **Vulnerability Type**: Unpinned and mutable third-party dependency execution **Risk Level**: High ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` The same section permits immediate execution through an unpinned `npx` invocation: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade instructions at `SKILL.md:58-64` additionally install the mutable latest release: ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill installs and executes `@iqinghu/qhkit` without pinning a reviewed package version or verifying package integrity. The `@latest` upgrade command explicitly permits the installed code to change after the Skill has been audited. An npm package can execute code through lifecycle scripts during installation and through its CLI entry point when invoked. Global installation is broader than necessary for a task-specific utility because it modifies the user's shared Node.js environment. Using `npx` does not remove the risk: it downloads and immediately executes the selected package version. No evidence establishes that the current package is malicious. The vulnerability is the unsafe trust and execution model, which exposes the Agent environment to registry, maintainer-account, mirror, and future-release compromise. ### Attack Path 1. An attacker compromises the package maintainer account, npm registry path, configured package mirror, or a future package release. 2. The attacker publishes a modified version under `@iqinghu/qhkit`. 3. The Agent follows the Skill and runs the unpinned global installation, `npx` invocation, or `@latest` upgrade. 4. Malicious lifecycle or CLI code executes with the operating-system privileges of the Agent user. 5. The malicious package accesses files, environment variables, API tokens, or media available to that user and may execute additional commands or alter user-owned configuration. ### Impact Assessment Suc ...[truncated 649 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specifically reviewed version rather than using an implicit current version or `@latest`. 2. Use a lockfile and verify the package integrity digest before installation. 3. Remove automatic `@latest` upgrades. Version changes should require explicit review and approval. 4. Avoid global installation. Install the package in a dedicated temporary project or isolated container with a controlled dependency tree. 5. Disable npm lifecycle scripts with `--ignore-scripts` where compatible with the package. 6. Run the CLI under a dedicated low-privilege account or sandbox with access only to the media files needed for the current task. 7. Restrict filesystem and network access and provide the API token only to the command that requires it. 8. Use only a trusted registry. Do not silently fall back to a mirror unless its trust and integrity controls have been independently established. ]]>
