T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:51
- Finding
- Unpinned CLI installation permits mutable third-party code execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 51–54 and 77–79 **Vulnerability Type**: Unpinned executable dependency installation **Risk Level**: Medium ### Complete Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The instructions also permit transient execution through: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade procedure explicitly installs the mutable latest release: ```bash npm i -g @iqinghu/qhkit@latest ``` Both npm installation paths may be redirected to: ```bash --registry=https://registry.npmmirror.com ``` ### Technical Analysis The skill installs and executes `@iqinghu/qhkit` without pinning an exact version or verifying the downloaded package's integrity against a review-time hash. The `@latest` upgrade command is explicitly mutable, while an unversioned `npm install` or `npx` invocation resolves according to the package registry state at execution time. npm packages may execute lifecycle scripts during installation and then operate with the privileges of the agent process. Consequently, compromise of the publisher account, registry infrastructure, mirror, package release process, or a newly published package version could turn these instructions into arbitrary code execution. Use of the npm mirror as a fallback adds another supply-chain trust boundary. No evidence establishes that the named package or mirror is currently malicious, so this finding concerns unsafe dependency acquisition rather than a confirmed malicious payload. The installation is relevant to the declared video-generation functionality, but global installation and automatic installation or upgrading exceed the minimum necessary privilege. A locally pinned installation with explicit user approval would be sufficient. ### Attack Path 1. An attacker compromises the npm publisher account, release process, registry response, or fallback mirror. 2. The attacker publishes or serves a modified version under the expected package name or ` ...[truncated 1012 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to an exact reviewed version rather than using an unversioned package or `@latest`. 2. Commit a lockfile containing npm integrity metadata and install with `npm ci --ignore-scripts` where lifecycle scripts are unnecessary. 3. If lifecycle scripts are required, audit them and document why before allowing their execution. 4. Prefer a project-local installation over `npm install -g`; invoke the pinned binary from `node_modules/.bin`. 5. Do not automatically upgrade in response to remote error messages. Present the proposed version and obtain explicit user approval. 6. Verify package provenance using npm signatures or attestations where available, and validate the package tarball against a trusted, review-time SHA-512 digest. 7. Avoid transparently changing registries. If a mirror is necessary, require explicit user approval and apply the same integrity and provenance validation. 8. Run the CLI in a restricted environment with access only to the required media files and API endpoint. ]]>
