Back to skill

Security audit

skill-alipayplus-integration

Security checks for vulnerabilities and agentic risk

Overview

This payment-integration skill is not clearly malicious, but it handles payment credentials and webhook data in ways that could expose secrets or financial records.

Review this skill before installing. Use it only with sandbox/test data unless you first harden the scripts: avoid pasting or printing real private keys, do not expose local services through ngrok without access controls, do not replay webhooks to production endpoints, restrict file permissions, redact logs, and fix the SFTP and signature examples before copying them into production code.

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 (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/debug-notify.sh:38
Finding

Unauthenticated Webhook Listener Logs Sensitive Requests and Can Be Publicly Exposed

Content
View full analysis
> "$LOG_FILE" # Use nc to receive requests request=$(nc -l -p "$port" -q 1 2>/dev/null || true) if [ -n "$request" ]; then timestamp=$(date '+%Y-%m-%d %H:%M:%S') echo "[$timestamp] Received request:" >> "$LOG_FILE" echo "$request" >> "$LOG_FILE" echo "-------------------" >> "$LOG_FILE" echo "✅ Notification received and logged to: $LOG_FILE" echo "" echo "Request content:" echo "$request" fi done ;; 2) # ... read -p "Enter local service port (default 8080): " port port=${port:-8080} echo "" echo "Starting ngrok, exposing port $port to the public network..." echo "" # Start ngrok ngrok http "$port" --log="$HOME/.openclaw/workspace/ngrok.log" & ``` ### Technical Analysis The debugging listener uses `nc` without restricting the listening interface, authenticating clients, validating Alipay+ signatures, limiting request size, or applying rate limits. Every received request is written verbatim to a predictable plaintext log file. Webhook requests can contain transaction identifiers, customer or merchant information, authorization-related headers, signatures, and payme ...[truncated 1702 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/test-signature.sh:70
Finding

Predictable Temporary File Enables Symlink-Based File Overwrite

Content
View full analysis
/tmp/verify_signature.bin verify_result=$(echo -n "$notify_content" | openssl dgst -sha256 -verify "$public_key_file" -signature /tmp/verify_signature.bin 2>&1) || true rm -f /tmp/verify_signature.bin ``` ### Technical Analysis The script writes decoded signature data to the fixed path `/tmp/verify_signature.bin`. The `/tmp` directory is normally writable by every local user. Shell output redirection follows symbolic links and does not securely create a new, exclusive file. A local attacker can create `/tmp/verify_signature.bin` as a symbolic link to another file writable by the victim. When the victim runs the script, the redirection truncates and overwrites the linked target with attacker-influenced decoded data. The fixed name also creates a race condition between concurrent invocations. One process may replace, delete, or read the temporary data used by another process, producing incorrect verification results or unintended file operations. ### Attack Path 1. A local attacker predicts the fixed temporary path. 2. The attacker creates a symbolic link: ```bash ln -s /path/to/victim-writable-file /tmp/verify_signature.bin ``` 3. The victim runs signature verification. 4. The shell follows the symbolic link when processing `> /tmp/verify_signature.bin`. 5. The target file is truncated and overwritten with decoded signature bytes. 6. The script subsequently removes the temporary pathname, while the target file remains corrupted. ### Impact Assessment The attacker can overwrite or corrupt files writable by the account running the Skill. If the Skill is run by a privileged account, the scope increases to privileged configuration or application files that the account can modify. The issue does ...[truncated 269 chars]
Remediation
View remediation
"$tmp_signature"; then echo "Invalid Base64 signature" >&2 exit 1 fi verify_result=$( printf '%s' "$notify_content" | openssl dgst -sha256 -verify "$public_key_file" \ -signature "$tmp_signature" 2>&1 ) || true ``` Where supported, avoid a temporary file entirely by using a secure in-memory mechanism or a private per-process directory. The script should also validate Base64 decoding errors before invoking OpenSSL. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/test-signature.sh:101
Finding

Generated RSA Private Key Is Printed and May Be Stored with Permissive Permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/reconciliation-guide.md:172
Finding

SFTP Example Disables SSH Host-Key Verification

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate-config.sh:121
Finding

Configuration Generator Encourages Plaintext Private-Key Storage Without Restrictive Permissions

Content
View full analysis
"$config_file" << EOF { "alipayplus": { "environment": "$environment", "role": "$role", "partnerId": "$partner_id", "clientId": "$client_id", "credentials": { "privateKey": "-----BEGIN RSA PRIVATE KEY-----\\nYOUR_PRIVATE_KEY_HERE\\n-----END RSA PRIVATE KEY-----", "alipayPlusPublicKey": "-----BEGIN PUBLIC KEY-----\\nALIPAY_PLUS_PUBLIC_KEY_HERE\\n-----END PUBLIC KEY-----" }, ``` The generated file is then presented with these instructions: ```bash echo "" echo "⚠️ Pending tasks:" echo " 1. Replace YOUR_PRIVATE_KEY_HERE with your application private key" echo " 2. Replace ALIPAY_PLUS_PUBLIC_KEY_HERE with the Alipay+ public key" if [ -n "$private_key_path" ] && [ "$private_key_path" != "" ]; then echo " 3. Private key file recorded: $private_key_path" fi ``` ### Technical Analysis The generated configuration is explicitly structured to contain the complete application private key in plaintext. The script instructs users to replace the placeholder with the real private key. The file is created using ordinary shell redirection without setting `umask 077` or applying mode `0600`. For a newly created file under a common `022` umask, the configuration may be readable by other local users. If the workspace is backed up, synchronized, indexed, or committed, the embedded key may also propagate into additional systems. The script asks for a private-key path but does not use it to implement safer key indirection. Instead, the generated configuration still contains an inline private-key placeholder. The JSON is also constructed by interpolating unescaped user input into a heredoc. Quotes, backslashes, control characters, ...[truncated 1670 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The code is related to one declared area—asynchronous notification debugging—but only implements a subset of the overall described assistant functionality. More importantly, it includes undeclared capabilities such as exposing a local service publicly via ngrok and sending arbitrary HTTP POST replay requests. The script is a narrow webhook debugging tool, not a broader Alipay+ payment integration assistant for configuration, signature verification, and reconciliation processing. Therefore the declared description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code partially aligns with the declared description because it supports signature verification testing and asynchronous notification signature debugging. However, the declared purpose presents a broader Alipay+ payment integration assistant with capabilities including configuration generation and reconciliation file processing, which are absent here. Additionally, the script includes an undeclared capability to generate RSA key pairs and display the private key content. That makes the actual code materially narrower in scope than the declared purpose while also adding a security-sensitive capability not explicitly mentioned.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/api-reference.md (reported line 60)May include surrounding context.

md
| API Name | Endpoint | Direction | Description | Documentation |
|----------|----------|-----------|-------------|-------------|
| `applyToken` (MPM) | MPP Endpoint | Alipay+ → MPP | MPP provides access token to Alipay+ | https://docs.alipayplus.com/alipayplus/alipayplus/api_mpp/apply_token |
| `getPaymentCode` (CPM) | `/aps/api/v1/codes/getPaymentCode` | MPP → Alipay+ | MPP calls this API to get payment code from Alipay+ | https://docs.alipayplus.com/alipayplus/alipayplus/api_mpp/get_payment_code |
| `userInitiatedPay` (MPM) | `/aps/api/v1/payments/userInitiatedPay` | MPP → Alipay+ | MPP sends order code to Alipay+, Alipay+ decodes and returns payment information | https://docs.alipayplus.com/alipayplus/alipayplus/api_mpp/pay_private_order_code |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/mpp-checklist.md (reported line 67)May include surrounding context.

md
| API Name | Endpoint | Direction | Description | Documentation |
|----------|----------|-----------|-------------|-------------|
| `applyToken` (MPM) | MPP Endpoint | Alipay+ → MPP | MPP provides access token to Alipay+ | https://docs.alipayplus.com/alipayplus/alipayplus/api_mpp/apply_token |
| `getPaymentCode` (CPM) | `/aps/api/v1/codes/getPaymentCode` | MPP → Alipay+ | MPP calls this API to get payment code from Alipay+ | https://docs.alipayplus.com/alipayplus/alipayplus/api_mpp/get_payment_code |
| `userInitiatedPay` (MPM) | `/aps/api/v1/payments/userInitiatedPay` | MPP → Alipay+ | MPP sends order code to Alipay+, Alipay+ decodes and returns payment information | https://docs.alipayplus.com/alipayplus/alipayplus/api_mpp/pay_private_order_code |

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation presents the Java SFTP example as normal usage while omitting any warning that it disables host key verification. This omission is dangerous because readers may copy the snippet directly, inheriting an insecure transport configuration that defeats server authenticity checks and exposes downloaded reconciliation data to interception or manipulation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The response/webhook verification example says to validate using response-time data, but the complete Java client passes the original requestTime into verify() and rebuilds the signed content with that value. This can cause valid signatures to fail verification or, worse, teach integrators to verify the wrong message components, undermining authenticity checks for responses and webhooks.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/test-signature.sh (reported line 75)May include surrounding context.

sh
echo "$signature" | base64 -d > /tmp/verify_signature.bin
    verify_result=$(echo -n "$notify_content" | openssl dgst -sha256 -verify "$public_key_file" -signature /tmp/verify_signature.bin 2>&1) || true

    rm -f /tmp/verify_signature.bin

    if [[ "$verify_result" == *"Verified OK"* ]]; then
      echo ""

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file documents getCurrentRegion as obtaining the user's current location, but it does not include any warning about privacy implications, consent, or handling of location data. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect user privacy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The onboarding flow explicitly tells users to fill configuration with a Partner ID, private key, certificates, and webhook URLs, but gives no warning about secure generation, storage, redaction, or avoiding disclosure in chat/session artifacts. In a skill intended to help configure payments, that omission can lead users to paste or persist live secrets insecurely, increasing credential leakage and downstream payment compromise risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The troubleshooting flow instructs users to replay test notifications but does not restrict this to sandbox or isolated endpoints, nor warn about side effects on production business logic. Replaying payment webhooks against live systems can retrigger fulfillment, status transitions, or reconciliation actions if idempotency is weak or endpoints are misconfigured.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The checklist explicitly includes location access, transaction history, API call logging, and security log review, but it does not require data minimization, consent, retention limits, redaction, or protection of personal and payment-related data. In a payment integration context, this omission can lead implementers to collect or retain privacy-sensitive data insecurely, increasing compliance and data exposure risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The guide encourages automated download and local storage/processing of reconciliation files that clearly contain transaction identifiers, order references, amounts, and status data, but it does not warn users to treat these artifacts as sensitive financial records. Without guidance on secure storage, access controls, retention, redaction, and protected exports, adopters may expose regulated or business-sensitive data through local workspaces, logs, or generated reports.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The Java SFTP example explicitly sets StrictHostKeyChecking to "no", which disables server host key verification and makes the client trust any host presenting itself as the server. This enables man-in-the-middle attacks, allowing interception or tampering of sensitive reconciliation files and credentials during transfer.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/reconciliation-guide.md (reported line 366)May include surrounding context.

bash
# Ensure private key has correct permissions
chmod 600 $SFTP_KEY

File Not Found

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The guide consistently specifies Base64Url for signatures, but the Java example uses standard Base64 encoding and decoding. Implementers who copy this sample may generate or verify incompatible signatures, causing verification failures or prompting unsafe workaround behavior such as disabling signature checks during integration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file includes an example of sending a Client-Certificate header containing Base64-encoded certificate content, which affects sensitive credential material and network transmission. The surrounding text explains how to do it but does not warn users about handling, exposure risk, or protecting certificate data in logs and transit.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The retry section claims Alipay+ determines delivery success from response fields result.resultStatus = S and result.resultCode = SUCCESS, implying a structured response payload. However, the actual webhook handler returns ResponseEntity.ok("SUCCESS"), and the same section later states success requires HTTP 200 plus a response body containing SUCCESS, which contradicts the earlier requirement.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document gives conflicting signature-handling guidance: the prose says the signature should be base64url-decoded, while the Java example uses the standard Base64 decoder. If implementers follow the sample code against a base64url-encoded signature format, valid webhook signatures may be rejected, causing dropped or repeatedly retried payment notifications; in some stacks, developers may weaken verification to 'make it work,' creating a path to forged webhook acceptance. In a payment webhook integration guide, ambiguity in cryptographic verification instructions is especially risky because merchants often copy sample code verbatim.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest describes an Alipay+ payment integration assistant focused on configuration, signature verification, asynchronous notification debugging, and reconciliation processing. In practice, this script starts a raw local listener with netcat and can send user-supplied JSON to any target URL, which makes it a general-purpose webhook server/replay tool rather than an Alipay+-specific debugger.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Incoming webhook requests are written verbatim to a persistent log file under the user's home directory without warning, minimization, or redaction. Payment notifications can contain personal data, transaction metadata, tokens, or signatures, so persistent plaintext logging creates unnecessary local data exposure and retention risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script can expose a local service to the public internet through ngrok, which materially expands the attack surface of the developer's machine or local webhook receiver. Although useful for webhook testing, the exposure is not constrained, authenticated, or accompanied by strong safety controls, so a user may unintentionally publish a sensitive local endpoint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Starting ngrok creates a public tunnel to the specified local port, which can affect system exposure and privacy. The script states that the port is exposed to the public network, but it does not provide a substantive safety warning or confirmation before enabling that exposure.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/debug-notify.sh (reported line 141)May include surrounding context.

sh
echo ""

    # Send POST request
    response=$(curl -s -w "\n%{http_code}" -X POST "$target_url" \
      -H "Content-Type: application/json" \
      -H "X-Alipayplus-Notification: true" \
      -d "$notify_content")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script creates a local directory and stores reconciliation CSV files, which likely contain financial transaction data. Although the script logs that files are being downloaded, it does not include any user-facing warning or comment about the sensitivity of the data, retention expectations, or the local storage impact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script generates a JSON configuration file in a predictable workspace location and includes credential fields, including an embedded private key placeholder, without checking for existing files, restricting file permissions, or clearly warning that the output is sensitive. In a payment-integration context, configuration files commonly end up populated with real secrets, so accidental overwrite, unintended disclosure via permissive default umask, or later inclusion in logs/version control can expose payment-signing material and operational endpoints.

Content

No source excerpt is available for this finding.