T08 · Insecure Dependencies
- Location
SKILL.md:22- Finding
Unpinned Third-Party Package Execution Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 22
Vulnerability Type: Unpinned and unattended third-party dependency execution
Risk Level: MediumComplete Code Snippet:
text - **If not installed**, prompt the user to run: npx -y @alipay/agent-payment@latest installThe original instruction invokes
npx -y @alipay/agent-payment@latest installto install and enable the payment capability.Technical Analysis
The Skill directs the Agent or user to download and execute the mutable
latestrelease of the third-party@alipay/agent-paymentnpm package.npxcan execute package code and lifecycle scripts, while-ysuppresses the normal confirmation prompt. The instruction does not pin a reviewed version, verify a package integrity hash, or require validation of the retrieved artifact.Consequently, the code executed at installation time can differ from the code reviewed when this Skill was audited. If the package publisher account, npm registry path, or a future release is compromised, attacker-controlled package code could execute with the privileges of the account running the Agent.
Attack Path
- An attacker compromises the referenced npm publisher account, package, registry delivery path, or a future
latestrelease. - The attacker publishes a malicious version under the package name referenced by the Skill.
- A user invokes this Skill while the required payment dependency is absent.
- The Skill recommends or causes execution of
npx -y @alipay/agent-payment@latest install. npxretrieves the attacker-controlled release and executes its package entry point or installation lifecycle scripts without an interactive package confirmation.- The malicious code operates with the filesystem, environment, and network permissions of the invoking Agent process.
Impact Assessment
Successful exploitation could provide arbitrary code execution under the invoking user ...[truncated 466 chars]
- An attacker compromises the referenced npm publisher account, package, registry delivery path, or a future
- Remediation
View remediation
Remediation Suggestions
- Replace
@latestwith an exact, reviewed package version. - Use a lockfile and verify the package against an approved integrity hash or trusted artifact manifest before execution.
- Remove
-yand require explicit, informed user confirmation before downloading or executing package code. - Prefer a separately reviewed installation process rather than dynamically invoking
npxduring the Skill workflow. - Run dependency installation in a sandbox with minimal filesystem, environment-variable, process, and network access.
- Disable or strictly control npm lifecycle scripts where operationally possible.
- Maintain an allowlist of approved package names, versions, publishers, and registry endpoints.
- Re-review and test each dependency upgrade before changing the pinned version.
- Replace
