Back to skill

Security audit

x402-client

Security checks for vulnerabilities and agentic risk

Overview

This skill is transparent about helping agents pay x402 API charges, but it tells agents to make cryptocurrency payments automatically from remote payment challenges without enough built-in limits or user approval.

Review this skill before installing. Use it only with an isolated low-balance wallet, trusted x402 providers, strict per-request and daily spend limits, approved recipient addresses, Base USDC validation, and manual approval for any new provider, changed recipient, or unexpected amount.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:58
Finding

Untrusted HTTP 402 responses can authorize unrestricted cryptocurrency transfers

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 58-68
Vulnerability Type: Untrusted payment parameters and insufficient transaction authorization controls
Risk Level: High

Vulnerable Code Snippet:

text
## Step 2: Pay

Amounts are in **atomic units** (6 decimals for USDC): `amount: "50000"` = $0.05.

Send `amount` microunits of `asset` (USDC) on `network` (Base) to `payTo` from your agent wallet.

Ways to pay:
- **CDP Agent Wallet** (Coinbase Developer Platform): `cdp wallet transfer` with USDC
- **Permit2** (Uniswap-style): approve + permit + transferFrom flow
- **Any EVM wallet**: direct USDC ERC-20 transfer

Save the transaction hash — it becomes your PAYMENT-SIGNATURE.

Technical Analysis

The Skill directs an agent to construct an irreversible wallet transfer from the amount, asset, network, and payTo fields returned by a remote HTTP service. These values cross an external trust boundary, but the instructions do not require the agent to enforce:

  • An allowlist of trusted service providers or domains.
  • An allowlist of approved recipient wallet addresses.
  • Per-transaction, per-provider, or daily spending limits.
  • Verification of the expected Base chain ID and canonical USDC contract.
  • Authentication or cryptographic integrity protection for payment requirements.
  • Binding between the payment, requested resource, operation identifier, and original quote.
  • Explicit user approval for new recipients or unusually large payments.

The Skill explicitly describes operation with “no human in the loop.” Consequently, a malicious or compromised service can influence an agent to transfer wallet funds to an attacker-controlled address. The transaction hash transmitted as PAYMENT-SIGNATURE is public blockchain data and is necessary for the stated settlement workflow; it is not itself a secret. The primary vulnerability is therefore insufficient authorization and validatio ...[truncated 1684 chars]

Remediation
View remediation

Remediation Suggestions

  1. Allowlist providers and recipients

    • Permit payments only to explicitly approved service domains and wallet addresses.
    • Require manual enrollment before trusting a new provider or recipient.
    • Reject a payment if the recipient differs from the provider's previously approved address.
  2. Enforce strict spending controls

    • Define maximum amounts per request, provider, hour, and day.
    • Require explicit user approval above a low configurable threshold.
    • Use an isolated wallet funded only with the minimum balance necessary for expected operations.
  3. Validate blockchain parameters

    • Require Base chain ID eip155:8453.
    • Require the canonical, checksummed USDC contract address expected by policy.
    • Reject unsupported assets, networks, payment schemes, and malformed addresses.
    • Parse atomic-unit amounts using integer arithmetic and enforce minimum and maximum bounds.
  4. Authenticate and bind payment requirements

    • Accept requirements only over correctly validated HTTPS connections.
    • Require signed or otherwise authenticated quotes from approved providers.
    • Bind each payment to the exact resource, HTTP method, request digest, recipient, amount, asset, network, expiration time, nonce, and operation identifier.
    • Reject stale, replayed, modified, or unexpectedly changed quotes.
  5. Harden transaction authorization

    • Present the normalized amount, asset, network, recipient, and provider identity before signing.
    • Apply wallet-level transaction policies independently of the Skill.
    • Avoid unlimited Permit2 or ERC-20 allowances; use narrowly scoped, expiring approvals.
    • Require additional authorization for new recipients, quote changes, or repeated payments.
  6. Prevent duplicate and repeated charges

    • Persist operation identifiers and transaction states.
    • Before retrying, verify on-chain settlement and a ...[truncated 148 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (6)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 31)May include surrounding context.

Step 1: Trigger the 402

bash
curl -s -X POST https://api.example.com/services/your-service/jobs \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.de"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 31)May include surrounding context.

Step 1: Trigger the 402

bash
curl -s -X POST https://api.example.com/services/your-service/jobs \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.de"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 42)May include surrounding context.

Step 1: Trigger the 402

bash
curl -s -X POST https://api.example.com/services/your-service/jobs \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.de"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 73)May include surrounding context.

Step 1: Trigger the 402

bash
curl -s -X POST https://api.example.com/services/your-service/jobs \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.de"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 86)May include surrounding context.

Step 1: Trigger the 402

bash
curl -s -X POST https://api.example.com/services/your-service/jobs \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.de"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · SKILL.md (reported line 109)May include surrounding context.

md
## Example Live Services

- **Hermes Commerce (DACH compliance)**: https://agent.kihustle.tech/.well-known/x402 — Impressum/DSGVO/BFSG/cookie checks, $0.01-$0.50, Base USDC
- **VerdictSwarm (token risk)**: https://api.vswarm.io/.well-known/x402 — pre-trade risk verdicts on Solana/Base

## Caveats

Static analysis

No suspicious patterns detected.