T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:52
- Finding
- Unpinned Third-Party Executable Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:52-69`, `SKILL.md:84-90`, and `SKILL.md:95-101` **Vulnerability Type**: Supply-chain exposure through mutable executable 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 ``` ```bash npx --yes sharp-cli -i 原图 -o 压缩后.jpg resize 2048 ``` The same instructions also permit alternate package and binary mirrors: ```bash npm i -g @iqinghu/qhkit --registry=https://registry.npmmirror.com ``` ```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" ``` ### Technical Analysis The Skill directs the Agent to download and execute mutable third-party packages without a lockfile, fixed package versions, package integrity values, or a documented review of package contents. The explicit `@latest` upgrade makes the executed implementation dependent on whichever release is current at invocation time. `npx --yes` similarly downloads and runs a package without interactive review. Global npm installation modifies the user's shared executable environment rather than using an isolated, task-specific environment. This exceeds the minimum privilege needed for a single image-generation request and may affect other sessions or tools that resolve the globally installed binary. Use of alternate npm and Python mirrors expands the set of infrastructure that must be trusted. A compromised maintainer account, upstream release, package registry, mirror, or dependency could introduce executable code after this Skill has been reviewed. The Node.js archive workflow is better protected: it uses a fixed HTTPS URL ...[truncated 1766 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@iqinghu/qhkit`, Pillow, and `sharp-cli` to reviewed versions rather than using implicit latest versions or `@latest`. 2. Record and verify package integrity hashes, and use lockfiles where the package manager supports them. 3. Remove automatic upgrade instructions. Present the proposed version and require explicit user approval before changing executable dependencies. 4. Prefer a project-local or isolated installation over `npm i -g`, such as a dedicated directory, container, or restricted virtual environment. 5. Avoid `npx --yes` for unreviewed packages. Preinstall a reviewed image-processing utility or invoke a pinned package with verified integrity. 6. Restrict package lifecycle scripts where feasible and review the dependency tree before execution. 7. Prefer primary registries. If a mirror is necessary, document its trust assumptions and verify artifacts against integrity data obtained from an independent trusted source. 8. For Node.js, pin the expected archive digest in the reviewed Skill or verify a signed release manifest rather than downloading both the archive and checksum from the same endpoint. 9. Run downloaded tools in a sandbox with access limited to the specific input and output files required for image processing. ]]>
