T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:45
- Finding
- Unpinned Third-Party Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 45–74 **Vulnerability Type**: Unsafe third-party dependency installation and execution **Risk Level**: Medium ### Technical Analysis The Skill directs the Agent to install and execute the `@iqinghu/qhkit` package without pinning it to an audited version or integrity value: ```bash npm i -g @iqinghu/qhkit ``` It also provides an `npx` fallback that can retrieve and immediately execute the current package version: ```bash npx @iqinghu/qhkit <command> ... ``` The upgrade procedure explicitly installs the mutable `latest` release: ```bash npm i -g @iqinghu/qhkit@latest ``` These commands allow package contents to change after the Skill has been reviewed. Global installation also modifies the Agent user's shared executable environment instead of using a task-scoped dependency directory. The optional use of an npm mirror expands the set of infrastructure that must be trusted. The `qhkit` dependency is necessary for the declared video-generation functionality, but global installation and execution of an unpinned release exceed the minimum required scope. A project-local, version-pinned installation would provide the required capability with less supply-chain and cross-session risk. The flagged Node.js pipeline is not a `curl | bash` operation. It downloads a fixed Node.js archive and verifies it against the vendor's checksum manifest before extraction: ```bash cd /tmp && curl -fsSLO https://nodejs.org/dist/v22.22.3/node-v22.22.3-linux-x64.tar.xz cd /tmp && curl -fsSL https://nodejs.org/dist/v22.22.3/SHASUMS256.txt | grep ' node-v22.22.3-linux-x64.tar.xz$' | sha256sum -c - mkdir -p "$HOME/.local/lib" && tar -xJf /tmp/node-v22.22.3-linux-x64.tar.xz -C "$HOME/.local/lib" ``` That specific pipeline validates data rather than executing downloaded shell code and is therefore not classified as a confirmed remote-payload vulnerability. ### Attack Path 1. An attacker compromises the npm publis ...[truncated 1079 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specific reviewed version rather than using an unconstrained package or `@latest`. 2. Record and verify package integrity using a lockfile and npm integrity metadata. 3. Install the package into a task-specific or project-local directory instead of the global executable environment. 4. Invoke the pinned local binary, such as through `npm exec --package=@iqinghu/qhkit@<approved-version>`. 5. Disable lifecycle scripts during installation where compatible: ```bash npm install --ignore-scripts --save-exact @iqinghu/qhkit@<approved-version> ``` 6. Permit upgrades only after explicit review of the new version and its provenance. 7. Restrict registries to an approved allowlist and avoid automatically switching to mirrors without equivalent integrity and provenance controls. 8. Run the CLI in a sandbox with access limited to the media files required for the current task and inject API credentials through a protected secret mechanism. ]]>
