Back to skill

Security audit

alipay-authenticate-wallet

Security checks for vulnerabilities and agentic risk

Overview

This Alipay wallet skill is mostly purpose-aligned, but it gives the agent high-impact payment-account authority while using unsafe command construction and missing confirmation for closing wallet authorization.

Review before installing. Only use this skill if you trust the Alipay npm package and are comfortable with a persistent local CLI that can bind or revoke wallet authorization. The artifact should be fixed to pass user values as safe arguments rather than shell strings and to require explicit confirmation before closing or unbinding payment capability.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:279
Finding

Shell Command Injection Through an Unvalidated Authorization Code

Content
View full analysis
``` The surrounding instructions require the authorization code supplied by the user to be passed directly to `bind-wallet`. They also prohibit local format validation and require the complete command string to be executed through the `exec` tool. ### Technical Analysis The authorization code is attacker-controlled input. It is inserted into a shell command without quoting, escaping, or validation. If `exec` interprets the documented command through a shell, metacharacters such as command separators, substitutions, or redirections are evaluated by the shell rather than passed exclusively as part of the `-c` argument. The instruction to let the CLI validate the value does not mitigate this issue because shell parsing occurs before `alipay-bot` receives its arguments. ### Attack Path 1. An attacker sends a message formatted as an authorization-code response. 2. The supplied value contains shell syntax, such as a benign proof-of-concept value equivalent to `123; id`. 3. The Skill extracts the entire value and constructs the documented command: ```bash alipay-bot bind-wallet -c 123; id ``` 4. The Agent passes the complete string to a shell-backed `exec` tool. 5. The shell runs `alipay-bot` and then executes the injected command. 6. More harmful commands could subsequently read or modify files, access process credentials, or initiate network connections. ### Impact Assessment Successful exploitation provides arbitrary command execution with the operating-system privileges of the Agent process. The attacker could potentially: - Read files accessible to the Agent account. - Modify project or user files. - Access credentials available to the process. - Execute additional local programs. - Initiate unauthorized outbound network requests ...[truncated 257 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:262
Finding

Shell Command Injection Through a Context-Derived Agent Name

Content
View full analysis
" ``` The Skill directs the Agent to obtain the Agent name from contextual data and interpolate it into a complete command string. Although the value is enclosed in double quotes, shell command substitution remains active inside double quotes. ### Technical Analysis Double quotes prevent ordinary word splitting but do not disable constructs such as command substitution. If an attacker can influence the Agent name or the contextual value used as its fallback, a value containing shell syntax such as `$(...)` or backtick substitution can cause an additional command to execute before `alipay-bot` starts. The exploitability depends on whether the runtime permits an untrusted party to control the current Agent name or associated contextual metadata. The unsafe command-construction pattern nevertheless creates a concrete injection boundary. ### Attack Path 1. An attacker or untrusted configuration source influences the Agent name used by the Skill. 2. The name contains a command-substitution expression. 3. The Skill interpolates the name inside the documented double-quoted argument. 4. A shell-backed `exec` implementation expands the substitution while parsing the command. 5. The injected command executes with the Agent process's privileges, and its output becomes part of the `--agent-name` argument. ### Impact Assessment If the Agent name is attacker-controlled, exploitation permits arbitrary command execution under the Agent account. Potential consequences include: - Reading or modifying files available to the Agent process. - Accessing process-level credentials or configuration. - Making unauthorized network requests. - Tampering with the wallet workflow. - Disrupting the host environm ...[truncated 187 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest says that when the user's intent is payment/checkout and a cashier link exists, this skill should not be triggered and alipay-payment-skill should handle it. However, later documentation defines a '支付拦截场景' where, during purchase/payment/checkout with an unbound wallet, this skill performs check-wallet and apply-wallet actions itself (L471-L480), creating a contradictory trigger and execution model for payment-context requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Mandating fixed Chinese-language output without checking the user's preferred language can cause users to misunderstand sensitive financial authorization steps, links, or warnings. In a payment-enablement workflow, comprehension failures can materially increase the chance of mistaken authorization, failed revocation, or unsafe handling of wallet state.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L275 requires that after apply-wallet, the reply must include additional guidance such as asking the user to enter an authorization code if the CLI template lacks certain keywords. But multiple higher-priority sections state the CLI output must be transmitted verbatim with no added wording at all, including L155-L166, L183-L186, and L382. These instructions actively conflict and would cause the skill to both preserve output unchanged and append extra text.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill authorizes execution of close-wallet for unbinding/closing payment capability without requiring an explicit confirmation or warning that the action will revoke payment authorization and may interrupt future payments. In a financial context, this can lead to unintended account state changes through ambiguous or accidental user phrasing, creating an integrity and availability risk around the user's payment setup.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs the agent to install and execute an external npm package and then run its CLI installer, which is arbitrary third-party code execution on the host. Although the document includes some safety measures such as pinned version, integrity checking, and user consent, those controls do not eliminate the core risk and this behavior is not clearly necessary for a wallet authorization skill whose stated purpose is account linking/status handling.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file adds a problem-reporting workflow and a CLI command (alipay-bot problem-feedback) that extends beyond the skill's declared scope of wallet enablement/authorization/unbinding. This scope expansion creates an additional action surface that can transmit user-derived content to an external system, increasing the chance of unauthorized data handling or misuse if invoked in the wrong context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document defines an outbound submission path to an external feedback system that is not directly necessary for wallet authorization. Even with some confirmation steps, it enables exfiltration of conversation-derived issue details to another system, which is risky because the skill is primarily for payment authorization and users may not expect support-ticket creation or cross-system data transfer in this context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The heading and rule content prescribe behavior entirely in Chinese, indicating a fixed language requirement for the skill's output behavior. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document is written as mandatory output rules in Chinese and repeatedly instructs the agent to preserve and return content exactly, but it does not offer any user language/locale choice or note that this constraint is optional. This can violate language/locale policy because it effectively forces a specific language behavior without explicit user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file’s natural-language instructions and safety documentation are fully presented in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to Chinese-speaking users. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.