T08 · Insecure Dependencies
Error
- Location
- SKILL.md:56
- Finding
- Unpinned Global Installation and Execution of a Mutable Third-Party Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:56-61` and `SKILL.md:82-86` **Vulnerability Type**: Uncontrolled third-party dependency installation **Risk Level**: High ### Complete Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The Skill also permits execution through an unpinned package reference: ```bash npx @iqinghu/qhkit <command> ... ``` The automatic upgrade procedure explicitly installs the current mutable release: ```bash npm i -g @iqinghu/qhkit@latest ``` The instructions additionally permit the following alternate registry: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill directs the Agent to install and execute `@iqinghu/qhkit` without pinning a reviewed version or verifying package integrity. The `@latest` upgrade command explicitly resolves to package contents that can change after this Skill has been audited. Global npm installation is especially sensitive because npm packages may run lifecycle scripts during installation. Such scripts execute with the privileges of the Agent process and can access files, environment variables, network resources, and user-level configuration available to that process. Allowing fallback to another registry expands the supply-chain trust boundary. Although the named mirror may be legitimate, the Skill does not require equivalent cryptographic package-integrity validation before executing packages retrieved through it. Installing the package globally is broader than the minimum privileges required to invoke a CLI. A pinned, isolated, user-local execution environment would reduce both modification scope and persistence. ### Attack Path 1. An attacker compromises the npm publisher account, a package release, a registry, a configured mirror, or another part of the package distribution chain. 2. The attacker publishes a malicious version as the current default or latest release. 3. The Agent detects that `qhkit` is unavailable or follows the documen ...[truncated 1111 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to an exact version that has been reviewed: ```bash npm install --global @iqinghu/qhkit@<reviewed-exact-version> ``` 2. Do not use `@latest` in an Agent-controlled automatic upgrade workflow. 3. Record and verify npm package integrity through a lockfile or an independently maintained cryptographic digest. 4. Prefer a project-local installation or isolated execution environment over global installation. 5. Disable npm lifecycle scripts where compatible: ```bash npm install --ignore-scripts ... ``` If lifecycle scripts are required, review them explicitly before installation. 6. Run the CLI in a sandbox with restricted filesystem, environment-variable, credential, and network access. 7. Require explicit user approval before installing or upgrading executable dependencies. 8. Apply the same version and integrity requirements to every registry or mirror. Do not silently switch package sources. 9. Document the exact reviewed package version and a controlled process for reviewing and approving updates. ]]>
