X402 Security Audit

    by Khristian Kopachelli

    1

    Security audit checklist for x402 and pay-per-call HTTP payment implementations.

    $15

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    X402 Security Audit

    Example session with this skill installed

    Audit this x402 payment handler. It verifies the EIP-712 signature, checks the amount is > 0, and logs the full payment-signature to CloudWatch for debugging.

    • Read your context and instructions
    • Compiled the x402 security audit

    I have audited the x402 payment handler logic provided. The implementation contains critical vulnerabilities related to amount verification and data privacy.

    Security Audit Findings

    SeverityCategoryFindingRecommendation
    CRITICALPayment VerificationAmount check is > 0 instead of ≥ quoted price.Update check to strictly enforce amount >= price.
    HIGHTrust BoundariesLogging full payment-signature to CloudWatch.Remove secret/signature logging; ensure only public payment info is logged.
    HIGHVerificationMissing network/chain ID allowlist check.Pin the network ID to prevent cross-chain replay attacks.
    MEDIUMVerificationAsset contract resolved by symbol, not address.Hardcode or pin the specific asset contract address (e.g., USDC on Base).
    MEDIUMReplayNo check for maxTimeoutSeconds or expiration.Reject signatures where the timeout has expired to prevent delayed replays.

    Evidence Collection Requirements

    1. Underpayment Test: Attempt a call with 0.000001 units of the asset. The server must return 402.
    2. Log Audit: Review the last 50 CloudWatch entries to ensure no private keys or internal wallet addresses were leaked during 500 errors.
    3. Cross-Chain Replay: Attempt to use a valid Polygon signature on the Base deployment. It must be rejected.

    Next steps

    • Patch the amount verification logic to match the quoted price immediately.
    • Implement a nonce-tracking ledger to ensure exactly-once execution.
    • Sanitize the logging middleware to exclude the payment-signature field.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Payment flows are the highest-stakes code in agent-facing APIs. A single oversight in signature verification or chain validation leads to direct financial loss. This skill provides a rigorous security audit framework for x402 and pay-per-call HTTP payment implementations.

    What it does

    • Payment Verification checks that signatures are cross-referenced against request schemes, networks, and pinned asset contracts.
    • Replay Protection audits nonce uniqueness and ensures settled payloads cannot authorize duplicate calls.
    • Trust Boundary Analysis scans for internal wallet data or sensitive logic leakage in public 402 headers and bodies.
    • Failure Path Auditing evaluates how the system handles scenarios where settlement succeeds but the handler fails.
    • Facilitator Risk Assessment reviews the verification guarantees of third-party payment facilitators and downtime policies.

    How it works

    1. Request Audit: Run the skill against your current x402 implementation or code snippets.
    2. Severity Analysis: The skill categorizes findings into a five-level severity ranking, prioritizing direct theft risks.
    3. Evidence Collection: It generates a list of required evidence, including testnet payment traces and deliberate failure logs.

    Frameworks & tools

    This skill is designed for x402 (HTTP 402) payment standards, EIP-712 signature verification, and Ethereum-compatible blockchains. It works with any web framework implementing pay-per-call headers.

    Why this beats prompting it yourself

    Generic security prompts often miss the nuances of decentralized payment flows, such as asset contract pinning or facilitator trust assumptions. This skill uses a specialized x402 checklist that addresses the specific ways agent-to-agent payments fail.

    Use cases

    • Reviewing a paid API implementation before production deployment.
    • Investigating a suspicious incident or potential payment bypass.
    • Hardening an existing pay-per-call integration against replay attacks.
    • Benchmarking a new payment facilitator's verification logic.

    Known limitations

    Requires manual review of logic for off-chain credit systems. Does not perform live on-chain transaction monitoring.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 5 days ago

    Requires

    Nothing to install.

    Permissions

    No special permissions declared or detected

    Listed5 days ago

    What's inside

    Frequently Asked Questions

    This skill provides a structured security audit framework specifically for HTTP 402 payment headers, signature verification (EIP-712), and replay protection to prevent financial loss in agent-to-agent transactions.

    The skill is framework-agnostic and compatible with any AI agent or web service implementing standard x402 headers and Ethereum-compatible signature verification.

    You will receive the full audit checklist, a severity ranking guide for vulnerabilities, and a template for collecting evidence such as testnet traces and failure logs.

    No, this skill is designed for static code review and implementation auditing; it does not require access to your private keys or a live connection to a blockchain.

    Yes, this skill is periodically updated to reflect the latest x402 standard changes and newly discovered attack vectors in the decentralized payment space.

    New in Web3 & Crypto

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Web3 & Crypto.