T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:29
- Finding
- Unpinned Global Installation of an Executable Third-Party Package## Vulnerability Details **File Location**: `SKILL.md`, line 29 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium **Vulnerable code snippet**: ```bash npm i -g @iqinghu/qhkit npm i -g @iqinghu/qhkit --registry=https://registry.npmmirror.com ``` ### Technical Analysis The skill instructs the agent to globally install and execute the latest available version of `@iqinghu/qhkit`. The dependency is not pinned to an audited version, and no package integrity, signature, or checksum verification is required. An npm installation may execute package lifecycle scripts, including installation hooks, with the privileges of the account running npm. A global installation also places executable files into shared system or user-level locations. Consequently, compromise of the package publisher, a newly introduced malicious package version, or compromise of the optional registry mirror could turn this installation step into arbitrary code execution. Use of the mirror expands the supply-chain trust boundary beyond the package's primary registry. The audit found no evidence that the named package is currently malicious; the vulnerability is the unsafe dependency acquisition and execution process. ### Attack Path 1. An attacker compromises the package publisher, publishes a malicious later version, or compromises the optional registry infrastructure. 2. The skill is invoked on a system where `qhkit` is unavailable. 3. Following the skill instructions, the agent executes the unpinned global npm installation. 4. npm downloads the attacker-controlled package release. 5. Malicious lifecycle scripts execute during installation, or malicious logic executes when the installed CLI is invoked. 6. The payload operates with the privileges of the user running npm and can access resources available to that account. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the agent's o ...[truncated 503 chars]
- Remediation
- ## Remediation Suggestions - Pin the dependency to a specifically reviewed version rather than installing the latest release. - Record and verify the expected package integrity hash before execution. - Prefer a project-local, isolated installation over a global installation. - Use the official npm registry unless an independently verified mirror is required. - Run installation and execution in a sandbox or container with minimal filesystem and network permissions. - Disable npm lifecycle scripts where compatible with the package, and separately review any scripts that must run. - Document the reviewed package version, publisher identity, registry source, and update procedure. - Require security review before changing the pinned version.
