T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:64
- Finding
- Unpinned Third-Party CLI Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:64-68` and `SKILL.md:91-95` **Vulnerability Type**: Unpinned and mutable third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` The documented fallback may also retrieve and immediately execute the package through `npx`: ```text npx @iqinghu/qhkit <command> ... ``` The upgrade procedure explicitly selects the mutable latest release: ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill instructs the Agent to install `@iqinghu/qhkit` without pinning an exact audited version. It also permits execution through `npx` and directs the Agent to upgrade automatically to the package registry's `latest` release. An npm installation can run package lifecycle scripts with the privileges of the invoking user. A global installation additionally places a mutable executable on the user's command path. The `npx` fallback can retrieve and execute the package directly, while the `@latest` command expressly allows the effective code to change after this Skill has been reviewed. The document permits both the default npm registry and a registry mirror. Consequently, security depends on the package maintainer account, package registry, mirror, and their associated distribution infrastructure. The audit found no evidence that the referenced package is currently malicious; the vulnerability is the absence of controls ensuring that the installed code is the version that was reviewed. The Skill's video-processing functionality does not inherently require a global, automatically updated installation. A pinned, project-local, integrity-verified installation would provide the required CLI with a smaller trust and privilege footprint. ### Attack Path 1. An attacker compromises the npm package maintainer account, registry publication process, mirror, or another relevant supply-chain component. 2. The attacker publishes a malicious version ...[truncated 1391 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to an exact version that has been reviewed: ```bash npm install --save-exact @iqinghu/qhkit@<audited-version> ``` 2. Remove automatic installation of `@latest`. Treat upgrades as a separate, explicit operation requiring user approval and security review. 3. Prefer a project-local installation over a global installation, and invoke the pinned binary from the local dependency directory. 4. Commit a lockfile containing npm integrity metadata, or independently publish and verify a cryptographic digest for the approved package artifact before installation. 5. Avoid an unpinned `npx` fallback. If `npx` is necessary, specify the exact approved version and prevent it from silently selecting another release. 6. Disable npm lifecycle scripts during installation where the package's operation permits it: ```bash npm install --ignore-scripts --save-exact @iqinghu/qhkit@<audited-version> ``` 7. Run the CLI in a restricted environment with access limited to the selected input video, required network endpoints, and a narrowly scoped API token. 8. Require explicit user confirmation before installing or upgrading executable dependencies, and clearly identify the registry or mirror that will be trusted. 9. Document a verified package provenance mechanism, such as signed releases, registry provenance attestations, or reproducible package hashes. ]]>
