T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:57
- Finding
- Unpinned Third-Party Package Installation and Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 57, 83, and 96 **Vulnerability Type**: Unpinned and mutable third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` ```bash npm i -g @iqinghu/qhkit@latest ``` ```bash pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i input.jpg -o compressed.jpg resize 2048 ``` ### Technical Analysis The Skill directs the Agent to install packages without pinning exact, reviewed versions or verifying package integrity. The `@latest` specifier and `npx --yes` invocation explicitly retrieve and execute whichever package release the registry currently serves. Package installation may also execute lifecycle scripts. The instructions permit alternate npm and Python package mirrors, expanding the supply-chain trust boundary. The global npm installation modifies the user's environment beyond the immediate Skill execution and makes the installed executable available to later sessions. These dependencies are functionally related to image generation and compression, but installing mutable global packages is not the minimum-risk way to provide that functionality. An isolated, version-pinned installation would reduce the required scope. ### Attack Path 1. An attacker compromises a package maintainer account, package release, or configured package registry. 2. A malicious version is published under one of the package names used by the Skill. 3. The Agent follows the bootstrap or upgrade instructions and runs `npm`, `pip`, or `npx`. 4. The package manager downloads the mutable package version. 5. Malicious lifecycle or runtime code executes with the privileges of the Agent process. 6. That code can access files, environment variables, API credentials, and images available to the Agent. ### Impact Assessment Successful exploitation permits arbitrary code execution with the current opera ...[truncated 541 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every dependency to an exact, reviewed version instead of using unqualified versions or `@latest`. 2. Record and verify package integrity hashes through an npm lockfile, npm integrity metadata, or an equivalent trusted manifest. 3. Replace global installation with a project-local, isolated installation or a restricted container. 4. Avoid automatic `npx --yes` downloads. Install a reviewed `sharp-cli` version in advance and invoke that fixed local binary. 5. Use a dedicated virtual environment and a hash-locked requirements file for Python dependencies. 6. Avoid package lifecycle scripts where compatible with the dependency, such as by using `--ignore-scripts` after confirming functionality. 7. Use one explicitly trusted registry rather than silently switching between multiple registries. 8. Run dependency installation and image processing under a restricted account with no access to unrelated files or secrets. 9. Require explicit user approval before modifying the environment, particularly before global installation or upgrades.
