Back to skill

Security audit

pay-for-402-service

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Alipay 402 payment-flow skill, with disclosed payment commands and user-payment handoff, but it depends on an external CLI and should be used only when the user expects an Alipay payment flow.

Install this only if you intend to let the agent assist with Alipay 402 payment-needed responses. Use it in an environment where npm package installation is controlled, confirm any payment in Alipay yourself, and do not allow it to proceed after Step 2 unless you actually completed the payment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
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: Medium

Complete 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 -y to download and immediately execute the external npm package @alipay/agent-payment@1.0.2 when alipay-bot is unavailable. The package implementation is not included in the audited project, so its installation hooks and install-cli behavior 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 -y option 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

  1. An attacker compromises the package publisher, registry account, registry infrastructure, or the artifact associated with the referenced package version.
  2. The skill runs in an environment where alipay-bot is not already installed.
  3. Following SKILL.md, the agent executes: npx -y @alipay/agent-payment@1.0.2 install-cli.
  4. npx retrieves the external package and executes its package code without interactive confirmation.
  5. Malicious lifecycle or CLI code runs with the permissions of the agent process.
  6. 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

  1. Vendor the required implementation into a reviewable, trusted distribution or preinstall the audited CLI in a controlled runtime image.
  2. Verify the package artifact using a trusted lockfile and cryptographic integrity digest before execution.
  3. Obtain packages only from an explicitly configured, authenticated registry and validate the expected package publisher.
  4. Replace unattended npx -y execution with a controlled installation process that requires explicit administrative or user approval.
  5. Disable npm lifecycle scripts during installation where operationally possible, then invoke only a separately verified executable.
  6. Run installation and payment tooling in a sandbox with minimal filesystem, environment-variable, and network access.
  7. Record and verify the installed executable's checksum before using it in the payment workflow.
  8. Prefer immutable deployment images so dependency installation does not occur dynamically during skill execution.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description is entirely in Chinese and prescribes when the skill should be used, but does not offer any language/locale choice or indicate that the skill is intentionally limited to Chinese-speaking users or a China-specific compliance context. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Step 2 requires verbatim forwarding of full CLI output to the user, while assuming the tool's built-in redaction is always sufficient. If the CLI emits overbroad diagnostics, signed links, tokens, filesystem paths, or attacker-influenced markup, the agent will disclose them directly, making the payment skill a trusted conduit for sensitive or unsafe content.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The Step 2 instructions conflict on whether the agent must output only the raw CLI text or may append additional guidance telling the user to notify after payment. In security-sensitive payment flows, contradictory output rules create ambiguous behavior that can lead agents to omit safety checks, duplicate untrusted tool output, or inconsistently add text around attacker-controlled content.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The MEDIA handling guidance is internally inconsistent: it says to output CLI content verbatim without extra formatting, but also includes conflicting directives about placing MEDIA below a code block while elsewhere forbidding code blocks entirely. In practice this confusion can cause agents to mishandle untrusted file references, duplicate content, or apply unsafe rendering logic to attacker-influenced output.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The workflow uses inconsistent identifiers for the payment reference, including tradeNo, trade_no, and tradeUniqueNo, across query and fulfillment steps. In a payment workflow, field confusion can cause acknowledgments to be sent for the wrong transaction, failed status checks, or incorrect binding between payment proof and purchased resource.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to transparently relay the purchased resource body directly to the user without semantic validation or data minimization. If the upstream resource contains secrets, internal headers reflected in body content, active content, or unintended sensitive data, the skill turns the agent into a blind exfiltration channel.

Content

No source excerpt is available for this finding.