x402 payment protocol lets attackers force merchants to subsidize compute, leaking up to 100% resources
Attackers can exploit synchronization gaps in x402 to cause full resource leakage from merchants
Security & privacy arXiv 29 May 2026 Attack Real-world evidence
Published as “Free-Riding in the AI Economy: Demystifying Logic Flaws in x402-Enabled Payment Systems”
Why it matters
Merchants deploying x402-enabled services risk large economic losses as attackers can obtain compute for free at scale.
Summary
Attackers can force merchants to subsidize compute costs, achieving a resource leakage ratio of up to 100% on production middleware. The paper formalizes five security invariants for x402, discovers two logic flaws-cross-resource substitution and probabilistic service duplication-and demonstrates allowance overdraft and denial-of-settlement attacks on official SDKs and live deployments, measuring full leakage in extreme cases. Evidence comes from a testbed with 50 concurrent requests showing zero settlement but full service delivery.
What they found 1
- In an extreme case, 50 verified requests were delivered with zero on-chain settlement, giving the attacker 11,101 wei of resources for free (leakage ratio 100%).
“In an extreme case, we achieved a scenario where 50 requests were successfully verified and delivered, but 0 settlement transactions were successfully finalized (i.e., all were blocked by the rate limiter). This resulted in the adversary obtaining 11,101 wei worth of inference resources at an absolute cost of 0 USDC, the leakage ratio is ρ ρ ρ = = = 1 10 00 0%.”
Caveats 2
- The probabilistic service duplication attack only succeeds with a significant success probability, not guaranteed.
- By exploiting the lack of atomic locking in the Facilitator, attackers can concurrently utilize a single nonce to procure multiple service instances, violating Authorization Uniqueness (I4) with a significant success probability (Section 4.3).
What’s new here 4
- First comprehensive security audit of the x402 protocol, defining five concrete security invariants.
- Discovery of cross-resource substitution due to context-agnostic signatures.
- Identification of probabilistic service duplication via nonce race conditions.
- Empirical evaluation of dynamic pricing attacks (allowance overdraft and denial-of-settlement) on live SDKs.