T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:54
- Finding
- Unpinned Third-Party Packages Are Installed and Executed## Vulnerability Details **File Location**: `SKILL.md`, lines 54-57; related update and fallback instructions at lines 80 and 93 **Vulnerability Type**: Supply-chain exposure through mutable, globally installed, and automatically executed dependencies **Risk Level**: Medium ### Vulnerable Code ```bash npm i -g @iqinghu/qhkit ``` Related commands: ```bash npm i -g @iqinghu/qhkit@latest pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple npx --yes sharp-cli -i source-image -o compressed-image.jpg resize 2048 ``` ### Technical Analysis The Skill directs the agent to install `@iqinghu/qhkit` globally without pinning an exact version or integrity value. It also explicitly instructs the agent to upgrade to `@latest`, meaning the code executed at runtime can differ from the version assessed during this audit. The `npx --yes sharp-cli` fallback downloads and executes a package without interactive confirmation or an exact version. Package installation can execute package lifecycle scripts, while the installed CLI subsequently runs with all permissions available to the agent's operating-system account. The use of additional package mirrors expands the set of infrastructure that must be trusted. There is no evidence that any named package or registry is currently malicious; the vulnerability is the unsafe dependency acquisition and execution model. ### Attack Path 1. An attacker compromises a package maintainer account, package release process, registry, or configured mirror. 2. The attacker publishes a malicious release under one of the dependency names used by the Skill. 3. The agent follows the bootstrap, upgrade, or image-compression instructions. 4. The package manager resolves the mutable dependency and downloads the compromised release. 5. Malicious lifecycle scripts or CLI code execute under the agent user's privileges. 6. The payload can access files, credentials, network resources, and processes ...[truncated 568 chars]
- Remediation
- ## Remediation Suggestions - Pin every dependency to a reviewed exact version rather than using an unconstrained package name or `@latest`. - Verify package integrity using a lockfile, trusted checksums, or registry integrity metadata. - Remove automatic upgrade instructions. Require a separate review before changing the approved version. - Avoid global installation. Run the CLI in a dedicated container, sandbox, or minimally privileged project environment. - Replace `npx --yes` with a pinned, pre-approved dependency installed from a lockfile. - Restrict installation to explicitly approved registries and avoid automatic mirror fallback. - Disable package lifecycle scripts where feasible and validate that required packages function under that restriction. - Limit filesystem and network access available to dependency processes.
