T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:36
- Finding
- Unpinned Third-Party Package Installation and Immediate Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 36–42 and 57–63 **Vulnerability Type**: Unpinned npm dependency installation and execution **Risk Level**: Medium ### Complete Code Snippets ```bash npm i -g @iqinghu/qhkit ``` The surrounding instructions also recommend using `npx` as a fallback, which can retrieve and immediately execute the package when it is not already installed. The upgrade procedure similarly installs the latest available version without pinning: ```bash npm i -g @iqinghu/qhkit@latest ``` The instructions additionally permit use of the following alternate registry when the official npm registry is unavailable: ```text --registry=https://registry.npmmirror.com ``` ### Technical Analysis The Skill depends on the third-party npm package `@iqinghu/qhkit`, but it does not pin installation to a specific reviewed version or require validation against a known package integrity hash. The explicit use of `@latest` makes the code executed by the Skill mutable after this audit. npm packages may run executable CLI code and lifecycle scripts during installation. Therefore, compromise of the package, its maintainer account, the registry distribution process, or the permitted mirror could result in arbitrary code being executed under the privileges of the user running the installation. The `npx` fallback increases this exposure because it can retrieve and immediately execute a package without a persistent, reviewable local installation. The project contains only `SKILL.md`; the package implementation is not included and consequently its token handling, upload behavior, lifecycle scripts, and runtime actions could not be independently reviewed. The global installation scope also exceeds the minimum scope necessary to invoke a single video-processing command. A project-local or isolated installation would reduce the affected environment. ### Attack Path 1. An attacker compromises the npm package maintainer account, packa ...[truncated 1923 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit` to a specific, reviewed version instead of using an implicit current version or `@latest`. 2. Record and verify the expected npm package integrity value before installation. 3. Remove automatic `@latest` upgrades. Require explicit user approval and security review before changing the installed version. 4. Prefer a project-local installation with a lockfile over global installation: ```bash npm install --save-exact @iqinghu/qhkit@<reviewed-version> ``` 5. Execute the pinned local binary from an isolated working directory rather than allowing `npx` to retrieve an unspecified release. 6. If `npx` must be supported, provide an exact version and prevent an implicit package download where practical. 7. Treat alternate registries as separate trust boundaries. Require the same package version and integrity digest regardless of the selected registry. 8. Review the package's lifecycle scripts and distributed CLI contents before approving a version. 9. Run the CLI under a dedicated, unprivileged account or sandbox with access limited to the intended input videos and required network endpoints. 10. Provide the API token only for the duration of the command and prevent unrelated processes or packages from reading persistent credentials. ]]>
