T08 · Insecure Dependencies
Error
- Location
- vipshop-product-detail/SKILL.md:24
- Finding
- Automatic Global Installation of an Unverified Third-Party CLI Package<![CDATA[ ## Vulnerability Details **File Locations**: - `vipshop-product-detail/SKILL.md:24-27` - `vipshop-product-search/SKILL.md:24-27` - `vipshop-promotion-search/SKILL.md:24-27` - `vipshop-user-login/SKILL.md:11-14` **Vulnerability Type**: Unsafe third-party dependency installation **Risk Level**: High ### Vulnerable Code Snippet ```bash npm install -g vipshop-cli@1.0.4 ``` The product-detail skill mandates the installation as follows: ```markdown ### Step 1: Check component installation and login status Before executing a query, the AI must check dependencies: 1. Check whether `vipshop-cli` is installed. If it is absent, install it globally: `npm install -g vipshop-cli@1.0.4` 2. Execute `vipshop status` to check login status. ``` Equivalent mandatory global-installation instructions appear in the product-search, promotion-search, and user-login skills. ### Technical Analysis The skills direct the Agent to install `vipshop-cli@1.0.4` globally from the npm registry. The supplied project does not include the package implementation, a lockfile, a cryptographic integrity value, a verified source repository, or other evidence that would allow the installed artifact and its transitive dependencies to be audited. Pinning the version reduces accidental version drift but does not establish package integrity or publisher trust. An npm installation may execute package lifecycle scripts, such as `preinstall`, `install`, and `postinstall`, with the permissions of the user running the Agent. The global installation also places the `vipshop` executable in a shared command search path. The installed CLI subsequently receives or manages security-sensitive data, including: - Vipshop QR login tokens. - Saved authenticated session state. - `PASSPORT_ACCESS_TOKEN` cookies. - Vipshop account API requests. Consequently, compromise of the package, its publisher account, registry artifact, or transitive dependency could affect both the local host and the authenticated V ...[truncated 1798 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not allow a skill to install a global package automatically. Obtain explicit user or administrator approval before changing the runtime environment. 2. Prefer a project-local installation inside a restricted sandbox or disposable container. 3. Vendor the required implementation into the reviewed project or reference a verified official repository whose source can be independently audited. 4. Use a lockfile and verify the npm artifact with a trusted cryptographic integrity value. 5. Review all direct and transitive dependencies before deployment. 6. Disable npm lifecycle scripts when they are unnecessary: ```bash npm install --ignore-scripts ``` This must only be used after confirming that the package legitimately works without installation scripts. 7. Run the CLI under a dedicated, least-privileged operating-system account with restricted filesystem and network access. 8. Avoid adding the dependency to a shared global command path. Invoke an audited binary through an absolute path. 9. Separate authentication storage from the CLI process and restrict token-file permissions. 10. Pin the allowed outbound destinations to documented Vipshop endpoints and monitor unexpected network connections. 11. Include the actual CLI source in the audit scope before allowing the skill to handle real account credentials. ]]>
