T08 · Insecure Dependencies
- Location
SKILL.md:59- Finding
Unverified npm Package Download and Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:59
Vulnerability Type: Insecure third-party dependency execution
Risk Level: MediumComplete Code Snippet:
markdown - `alipay-bot` CLI 工具已安装。**优先检测本地是否已安装**:先执行 `which alipay-bot`,如已存在则跳过安装;如未安装,执行:`npx -y @alipay/agent-payment@1.0.2 install-cli`Technical Analysis
The skill instructs the agent to use
npx -yto download and immediately execute the external npm package@alipay/agent-payment@1.0.2whenalipay-botis unavailable. The package implementation is not included in the audited project, so its installation hooks andinstall-clibehavior cannot be reviewed from the repository.Pinning an exact version reduces unintended version drift, but it does not independently verify package integrity or publisher authenticity. No lockfile, cryptographic integrity value, vendored source, or signature-verification procedure is provided. The
-yoption also suppresses the normal installation confirmation.npm package execution can invoke lifecycle scripts and package-provided commands with the privileges of the agent process. Consequently, compromise or replacement of the referenced package artifact could turn this documented installation step into arbitrary local code execution.
Attack Path
- An attacker compromises the package publisher, registry account, registry infrastructure, or the artifact associated with the referenced package version.
- The skill runs in an environment where
alipay-botis not already installed. - Following
SKILL.md, the agent executes:npx -y @alipay/agent-payment@1.0.2 install-cli. npxretrieves the external package and executes its package code without interactive confirmation.- Malicious lifecycle or CLI code runs with the permissions of the agent process.
- That code could inspect accessible files and environment variables, modify local tools, install additional components, or perform ne ...[truncated 873 chars]
- Remediation
View remediation
Remediation Suggestions
- Vendor the required implementation into a reviewable, trusted distribution or preinstall the audited CLI in a controlled runtime image.
- Verify the package artifact using a trusted lockfile and cryptographic integrity digest before execution.
- Obtain packages only from an explicitly configured, authenticated registry and validate the expected package publisher.
- Replace unattended
npx -yexecution with a controlled installation process that requires explicit administrative or user approval. - Disable npm lifecycle scripts during installation where operationally possible, then invoke only a separately verified executable.
- Run installation and payment tooling in a sandbox with minimal filesystem, environment-variable, and network access.
- Record and verify the installed executable's checksum before using it in the payment workflow.
- Prefer immutable deployment images so dependency installation does not occur dynamically during skill execution.
