← Lab /Security & privacy

x402 payment protocol vulnerable to five practical attacks

X402 is vulnerable to five attacks that can cause unpaid service or paid-but-denied outcomes.

Security & privacy arXiv 12 May 2026 Attack Prototype evidence Threat model

Published as “Five Attacks on x402 Agentic Payment Protocol”

Why it matters

Agents and services that adopt x402 risk financial loss or service denial unless they adopt the proposed mitigations.

Summary

All five attacks on the x402 payment protocol are practical, allowing unpaid service or paid-but-denied outcomes. The authors demonstrate a revert-grant probability of up to 5.18% under optimistic execution, a duplicate-grant rate of 248 grants per payment, header-proxy leaks with 100% success, and server-selection bias up to 71.8%. They validate these attacks on local chains, Base Sepolia, and four live endpoints using a reproducible testbed of 25,000 requests across 48 configurations. The paper provides a formal security model and concrete mitigations, but the evaluation sections are limited to the provided excerpts.

What they found 6

  1. Revert-grant (optimistic execution) occurs with up to 5.18% probability, and 100% under Byzantine facilitator behavior.

    “RGP0 5.18%; Byzantine: 100%”

  2. Replay/idempotency attack can produce unlimited duplicate grants, observed as 248 grants per payment in live tests.

    “DGR =n; live: 248 grants/payment”

  3. Header/proxy confusion leads to full leakage of paid content via nginx and CDN caches.

    “nginx leak: 100%; live CDN leak”

  4. Server-selection manipulation can bias agents toward malicious servers, achieving 71.8% capture with a crafted server and 60.2% with five Sybils.

    “One crafted server: 71.8%; five Sybils: 60.2%”

  5. All five attacks are reproduced on a testbed spanning local chains, Base Sepolia, and live endpoints.

    “We validate these attacks through a reproducible testbed on local chains, Base Sepolia, and live endpoints”

  6. The authors claim that all five attacks are practical and can cause either unpaid service or paid-but-denied outcomes.

    “Our results show that all five attacks are practical and can cause either unpaid service or paid-but-denied outcomes.”

Caveats 2

  • The revert-grant probability is limited to 5.18% in optimistic execution, suggesting the attack may not succeed in the majority of cases.
  • Replay attacks produce unbounded duplicate grants (DGR = n) but the paper does not quantify a realistic upper bound, leaving the practical impact uncertain.

What’s new here 4

  • First formal security analysis and model of the x402 cross-layer payment protocol.
  • Identification and empirical validation of five distinct attacks spanning discovery, settlement, replay, proxy handling, and server selection.
  • A reproducible testbed covering local chains, a public testnet (Base Sepolia), and live production endpoints.
  • Coordinated disclosure of 11 vulnerabilities across three SDKs and four live services.

Threat model stated by the source

AdversaryA probabilistic polynomial-time (PPT) adversary A with capabilities across network, client, facilitator, blockchain, and optionally server components.
CapabilityAN, AC, AF, AB (network delay/replay, client payload manipulation, Byzantine facilitator, mempool/transaction manipulation)
AssumesTLS provides confidentiality and integrity of HTTP messages.; Blockchain finality follows a k-deep bound with Pr[Reorg(depth ≥k)] ≤ εchain(k).; Honest facilitators are deterministic; Byzantine facilitators may behave arbitrarily.