T09 · Insecure Skill Coding Practices
- Location
SKILL.md:57- Finding
Automatic x402 Wallet Payments Lack Locally Enforced Transaction Constraints
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:57-64;references/INTEGRATION.md:27-29,82-92
Vulnerability Type: Unrestricted automatic wallet payment authorization
Risk Level: MediumVulnerable Code Snippets
SKILL.md:57-64:markdown Uses **x402 protocol**. Your wallet handles payment automatically: 1. Server responds HTTP 402 with payment requirements 2. Wallet signs USDC payment on Base Mainnet 3. Request retries with payment signature 4. Full artifact set returned after settlement No accounts. No API keys. Payment is the only gate.references/INTEGRATION.md:27-29:javascript // Agent can now browse and purchase Clawdio reports automatically. // Point it at https://clawdio.vail.report/ and it will self-discover the API.references/INTEGRATION.md:82-92:text | [wallet signs USDC payment] | | | | | | GET /catalog/purchase?id=... | | | (PAYMENT-SIGNATURE header) | | |------------------------------>| | | | verify + settle payment | | |----------------------------->| | | settlement confirmation | | |<-----------------------------| | 200 OK | | | (full artifacts + tx hash) | |Technical Analysis
The documented integration delegates x402 payment handling to an agent wallet and states that report purchases may occur automatically. However, the examples do not demonstrate local validation of the payment requirements returned by the remote server.
In particular, the integration does not explicitly enforce:
- The expected Base ...[truncated 2442 chars]
- Remediation
View remediation
Remediation Suggestions
- Parse and validate every x402 payment requirement before requesting a signature.
- Enforce the exact expected chain ID, canonical USDC contract, approved recipient, and a maximum amount of
1.49 USDCper report. - Bind authorization to the selected catalog product and reject mismatched, expired, replayed, or reused payment requirements.
- Require explicit user confirmation that displays the recipient, asset, network, and total amount before settlement.
- Configure a dedicated low-balance wallet with strict per-transaction and daily spending limits rather than using a general-purpose wallet.
- Reject redirects or cross-origin payment destinations unless they are explicitly allowlisted.
- Pin the expected API origin and rely on strict TLS certificate validation.
- Log payment requests and settlement results without recording wallet secrets or reusable authorization material.
- Update the integration examples to show validation and rejection logic instead of presenting automatic signing as unconditional.
- Clarify which protections are enforced by AgentKit or
@x402/fetchand which controls must be implemented by the integrating application.
