x402 flaws put AI agent wallets and payments at risk

V12 found 25 x402 vulnerabilities, including three critical flaws that could drain an AI agent wallet, accept Solana approvals as payments or misdirect wallet login signatures.

Security firm V12 found 25 vulnerabilities in the x402 payment protocol, including three critical flaws affecting AI agent wallets, Solana payments and wallet-based logins. Fixes began shipping Aug. 18, 2026. The x402 Foundation has not issued a security advisory or CVE for the vulnerabilities.

V12 reported three critical and 13 high-severity flaws to the x402 team on Aug. 12. The critical issues were fixed by Aug. 20, and nine medium- and low-severity issues were fixed Sept. 9. V12 published details of the findings Oct. 22. No attacks exploiting the flaws have been publicly reported.

The most serious flaw affected the default x402 client used by agents to pay for API requests. Before the fix, the client did not limit the amount requested by an API. A hostile service could request an amount equal to the agent wallet’s balance. An agent using an automatic signer and no separate spending policy could approve the payment without human review.

Version 2.23.0 added spending controls. The default limit is $1 per payment, and recognized U.S. dollar-pegged stablecoins are allowed. Developers can set approved assets and other limits. Setting `spendControls: false` disables the protections and restores the previous unrestricted behavior.

The second critical flaw affected the TypeScript Solana facilitator, which checks whether a payment transaction is valid. The facilitator verified that a transaction called an approved token program, then treated a later instruction as `TransferChecked` without confirming its type. A Solana `ApproveChecked` instruction uses similar data but grants permission to spend tokens rather than transferring them.

A merchant could therefore provide a paid resource after receiving a transaction that moved no funds. The flaw affected TypeScript versions of `@x402/svm` from 2.0.0 through 2.22.0. Version 2.23.0 added a check confirming that the transaction contains a genuine `TransferChecked` instruction. The Python and Go SDKs already had that check.

The third critical flaw affected Sign-In-With-X, or SIWx, an x402 extension for wallet-based authentication. The automatic signing wrapper did not confirm that the website and URI in a login request matched the site contacted by the agent. A malicious API could pass a login challenge from another service to the agent and obtain a signature that could grant access to that service.

From version 2.23.0, `createSIWxPayload` requires the final URL from the payment response and rejects signatures when the origins do not match. The `@x402/fetch` and `@x402/axios` wrappers supply that URL automatically.

The affected TypeScript packages, including `@x402/fetch`, `@x402/axios`, `@x402/extensions`, `@x402/svm` and `@x402/core`, received fixes in version 2.23.0. The latest TypeScript release was 2.28.0 on Oct. 23. The Python package included the fixes from version 2.20.0, released Aug. 18, and version 2.25.0 was the latest release. Go users were advised to upgrade beyond the releases issued Aug. 18.

Npm download data for the seven days ending Oct. 25 showed that 55.2% of `@x402/fetch` downloads were for 2.x versions released before 2.23.0. Older versions accounted for 49% of `@x402/extensions`, 29% of `@x402/svm` and 39.7% of `@x402/core` downloads. Download figures include automated builds, cached installations and other activity, so they do not confirm how many deployments remain vulnerable.

Because there is no formal security advisory, tools such as `npm audit` and PyPI checks may not identify the affected releases. Developers can use `npm ls` to check installed packages and upgrade x402 dependencies to version 2.23.0 or later. They should set per-payment and total spending limits, restrict tokens, networks and recipients, and avoid disabling spending controls in production. Server operators should use version 2.27.0 or later to address a separate route-validation bypass involving encoded paths.

Articles by this author