Research · x402guard

The State of x402 Security

The headlines say agent payments are a hack waiting to happen — "200+ wallets drained." So we pointed our scanner at the actual code. The reality is more reassuring, and more specific, than the headlines suggest.

61%
had zero findings of any severity
0
critical vulnerabilities across the sample
~1 in 8
scored C or worse
81
error / stack-trace leaks — the #1 issue by far

The good news: the basics are mostly handled

We scanned 23 public repositories with x402 in their name using x402guard's 15-rule integration-layer ruleset. Fourteen of them (61%) came back completely clean, and not a single one had a critical finding. The catastrophic pattern x402guard was built to catch first — a server endpoint that signs and broadcasts a transaction with no authentication — didn't appear once in this sample. The ecosystem is paying more attention than the drama implies.

The recurring weak spot: you're leaking your internals

One issue dwarfed everything else. Error and stack-trace leaks accounted for 81 of all findings — endpoints returning a raw error (or full stack trace) in the HTTP response. On its own it's "only" medium severity. But to an attacker probing an agent-payment API, a leaked stack trace is a free map: file paths, dependency versions, framework internals, sometimes the shape of a database query. It's the reconnaissance step that makes the next attack cheap.

The fix is trivial — return a generic error to the client, log the detail server-side — which is exactly why it's worth doing. Free defense rarely is.

...and the tail is genuinely dangerous

Averages hide the risk. While most projects were clean, roughly one in eight scored C or worse, and the worst carried four separate high-severity findings — including a value-moving contract function with no reentrancy guard and privileged setters with no access control. When x402 code goes wrong, it goes wrong around money. (We don't name individual repos — these were reported through normal channels, not published.)

Beyond the leaks, the other patterns that showed up:

The takeaway

x402 builders are getting the headline stuff right — the missing-auth, money-moving disasters are rare. The real exposure has moved to the web↔chain glue: error handling, access modifiers, randomness, CORS, rate limiting. None of it is caught by Slither or MythX, because none of it lives in the contract. It lives in the integration — and the integration is now the soft underbelly of agent payments.

How does your x402 integration score?

Paste a snippet or scan a public repo — free, no signup, same 15-rule engine.

Scan my code →
npx x402guard .
Methodology. 23 public GitHub repositories with x402 in the name, actively pushed in 2026, scanned via the public x402guard grader (15-rule integration-layer ruleset) in June 2026. Awesome-lists and security tooling were excluded; demos and integrations were included. Counts are finding-instances across the sample. x402guard is heuristic static analysis — it has false positives and negatives and complements, but does not replace, a professional smart-contract / ZK audit. Individual repositories are not named; any high-severity issues were communicated privately.