T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:40
- Finding
- Unpinned Third-Party npm Package Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 40–42 and 66–68 **Vulnerability Type**: Unpinned and mutable third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` The surrounding instructions also recommend directly invoking the package through `npx`: ```text Only when global installation fails because of permissions and privilege elevation is unavailable, fall back to `npx @iqinghu/qhkit <command> ...`. ``` The upgrade instructions explicitly select the latest available release: ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill installs and executes `@iqinghu/qhkit` without pinning it to a reviewed version or verifying package integrity. Both the unversioned `npm install` command and the explicit `@latest` command resolve to mutable package content at execution time. The `npx` fallback can also download and immediately execute package code when the package is not already available locally. Consequently, the code executed by the Agent can differ from the content that existed when this Skill was audited. A malicious or compromised future release, compromised publisher account, registry compromise, or unsafe mirror response could introduce arbitrary JavaScript, npm lifecycle scripts, or malicious CLI behavior. The Skill permits a fallback from the official npm registry to `https://registry.npmmirror.com`. Although the document identifies this as a network fallback rather than an intentionally unsafe source, adding another dependency-distribution trust boundary increases supply-chain exposure. This dependency is security-sensitive because the CLI is configured with a LinkPix API token and receives local video paths for automatic upload. A compromised package would execute with the permissions of the account running the Agent and could access data available to that account. ### Attack Path 1. An attacker compromises the npm publisher account, package ...[truncated 2079 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specific, reviewed version rather than using an unversioned package or `@latest`: ```bash npm install -g @iqinghu/qhkit@<reviewed-version> ``` 2. Record and verify the expected npm package integrity value or artifact checksum before execution. Obtain the expected digest through a separately trusted and reviewable release process. 3. Remove automatic upgrade instructions based solely on stderr notices or server-provided messages. Require explicit user approval and security review before changing the installed version. 4. Avoid `npx` behavior that implicitly downloads and immediately executes a package. If `npx` is necessary, pin the exact version, prohibit substitution, and require confirmation before download. 5. Consider installing the dependency in an isolated, non-privileged environment rather than globally. Restrict filesystem access, environment variables, and outbound network access to what video processing requires. 6. Disable npm lifecycle scripts during installation where compatible: ```bash npm install -g --ignore-scripts @iqinghu/qhkit@<reviewed-version> ``` If lifecycle scripts are required, review them before installation and document why they are necessary. 7. Prefer the official registry. If a mirror must be supported, independently verify package integrity against a digest obtained from a trusted source rather than trusting both the package and its metadata from the same mirror. 8. Request explicit user consent before installing or upgrading software, uploading local media, or configuring an API token. Never expose the token in command output or diagnostic messages.
