Back to skill

Security audit

Alipay Pay For 402 Service

Security checks for vulnerabilities and agentic risk

Overview

This payment skill is mostly coherent, but it includes a risky raw shell retry command in a financial flow that warrants careful review before installation.

Review this skill before installing. Only use it if you trust the Alipay npm package and the merchants involved, and avoid using the retry flow with untrusted or user-supplied resource URLs unless the agent can enforce strict URL validation and safe argument handling. Confirm any feedback payload before submission and do not include secrets or personal data unnecessarily.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:255
Finding

Shell Command Injection in the Payment Retry Workflow

Content
View full analysis
| grep -i "^Payment-Needed:" | sed "s/^[Pp]ayment-[Nn]eeded: //" | tr -d "\r\n" > <402_needed_file.txt> && alipay-bot 402-buyer-pay -f <402_needed_file.txt> ``` ### Technical Analysis The retry command places `` and `<402_needed_file.txt>` directly into a shell pipeline without quoting or using a structured subprocess interface. If either value can contain shell metacharacters, the shell will interpret those characters as command syntax rather than as literal argument data. The surrounding instructions claim that resource URLs and filenames must be validated, but this retry branch does not define or demonstrate an enforceable validation operation before interpolation. In particular, checking only that a resource URL starts with `https://` would not be sufficient because a string can satisfy that prefix requirement while also containing shell operators such as `;`, `&`, `|`, command substitutions, redirections, or whitespace-delimited arguments. The filename substitution is also used as a redirection target. If validation is omitted, implemented incorrectly, or bypassed, this may permit unintended file creation or overwrite in addition to command execution. ### Attack Path 1. An attacker controls or influences a service that returns an HTTP `402 Payment Required` response. 2. The associated resource URL contains shell syntax while retaining an apparently valid HTTPS prefix. 3. The initial payment operation returns the signature-validation error that activates the documented retry branch. 4. The agent substitutes the malicious resource URL into the unquoted `curl` command. 5. The command is passed to a shell execution tool. 6. The shell interprets the injected metacharacters and executes attac ...[truncated 936 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:92
Finding

Externally Retrieved npm Package Executes Installation Code and Modifies PATH-Visible Tooling

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description and all operational instructions are written as mandatory Chinese interaction guidance, including prescribed user-facing messages, but there is no opt-in or alternative language path. This can violate language/locale policy because it imposes a specific language on users regardless of their preference.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The retry flow instructs the agent to issue a direct curl request to an attacker-controlled or untrusted resource-url and process response headers, creating an external transmission and SSRF-style risk. In this context, the URL comes from the original purchase flow and may target arbitrary internal or sensitive endpoints, causing network access outside the intended trusted CLI boundary and leaking request metadata to third parties.

Content

Scanner excerpt · SKILL.md (reported line 262)May include surrounding context.

使用以下命令模板重试,注意将替换为请求的资源地址、<402_needed_file.txt>替换为保存文件的临时目录地址,并且根据资源请求方式(GET/POST)适配命令:

text
curl -s -D - -o /dev/null <resource-url> | grep -i "^Payment-Needed:" | sed "s/^[Pp]ayment-[Nn]eeded: //" | tr -d "\r\n" > <402_needed_file.txt> && alipay-bot 402-buyer-pay -f <402_needed_file.txt>

成功后继续流程。如果重试2次后依然不成功,提示用户"支付失败,商户签名验证不通过"并终止流程

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill adds a generic problem-feedback path that packages conversation-derived text and submits it to Alipay, which exceeds the narrowly stated purpose of handling a 402 payment flow. Because the text is assembled from dialogue context, it can include unnecessary user data, service responses, or other sensitive details, creating an avoidable data exfiltration channel to an external party.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The skill claims it should only be used for HTTP 402 handling, but later expands behavior to user-triggered issue reporting. This scope creep is dangerous because operators or agents may trust the initial narrow scope while the skill actually authorizes additional actions and external data sharing beyond payment handling.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.