Every x402 project fails npm audit
Run npm audit in any x402 seller or buyer today and it comes back red: a high advisory in zod, reached through @x402/core, @x402/evm, @x402/extensions, @x402/mcp, @coinbase/x402 and @coinbase/cdp-sdk. The advice npm prints next to it would break your payments. We read where x402's own code actually uses zod, and measured what the bug does.
Update, 28 October 2026: @x402/* 2.29.0 moved to zod 4 (^4.6.6, the fixed release). Upgrade and the advisory no longer comes through x402's own packages. It still comes through @coinbase/x402 and @coinbase/cdp-sdk, which require zod 3. In our three services the high findings went from 27 to 18 and from 14 to 4. Upgrading changed three more things; see Upgrading to 2.29.0.
Update, 2 November 2026: Coinbase has not released a fix yet. @coinbase/x402 is still 2.1.0 (December 2025) and @coinbase/cdp-sdk 1.60.0 (22 October 2026), and both still require zod 3. This week's audit of our three services found 4 high findings in each, all the same: zod 3, abitype, @coinbase/cdp-sdk and @coinbase/x402. Our wallet server, which doesn't use Coinbase's packages, came back clean. Few projects have upgraded so far: in npm's download count for the last seven days, 5% of @x402/core downloads were 2.29.0. See Who still has zod 3.
What the advisory is
When zod validates an array and many of its items fail, it keeps one issue object for every failing item, with no limit and no early stop. A large enough array of bad items exhausts the process's memory and crashes it. The bug was reported in 2023 (zod#1872) and fixed in zod 4.6.6; the advisory followed on 1 October 2026. Zod 3 gets no fix.
We measured it with the zod 3.25.76 that x402 installs, using @x402/core's own PaymentRequired schema and an accepts array of zeros:
| Items in the array | JSON size | Memory used | Time |
|---|---|---|---|
| 10,000 | 20 KB | 4 MB | 33 ms |
| 100,000 | 0.2 MB | 39 MB | 121 ms |
| 500,000 | 1.0 MB | 152 MB | 0.8 s |
| 1,000,000 | 2.0 MB | 309 MB | 1.8 s |
About 150 bytes of memory for every byte sent. Two megabytes is enough to take down a 512 MB server, the size of many small hosting plans.
Where x402 runs zod
The table above only matters where outside data reaches a zod array schema. In @x402/core 2.28.0 we found one such place on the paid path:
- The buyer's payment header (
PAYMENT-SIGNATURE) is decoded withJSON.parse, not validated with zod. Node also caps all request headers at 16 KB, which in the table is under 3 MB of memory even if it were. - A seller's 402, on the buyer's side:
@x402/fetchreads thePAYMENT-REQUIREDheader or the v1 body withJSON.parseand does not run zod on it. - The facilitator's answers to verify and settle are validated with zod. That data comes from the facilitator you configured yourself, such as Coinbase's CDP facilitator, not from buyers.
So x402 itself gives a buyer or a seller no way to send you an oversized array that zod then chews on. The audit warning is real, but it isn't a hole in your payment flow.
Why npm audit fix makes it worse
npm's suggested fix is to "downgrade" @coinbase/x402 to 0.0.0, @x402/evm, /svm, /express and /extensions to 0.0.1, and mppx to 0.8.19. @coinbase/x402 0.0.0 is a two-file "placeholder package" and @x402/evm 0.0.1 holds three files; mppx 0.8.19 is a much older release. npm audit fix --force installs them and payments stop working. Plain npm audit fix, without --force, doesn't touch them and still fixes the advisories that do have a fix (on 26 October 2026 that included body-parser, follow-redirects and undici).
Where the risk really is: your own zod 3
Many x402 servers use zod themselves to check request bodies, and the same package resolves to zod 3 through x402. An array in your schema and a body you didn't cap is exactly the table above. Three things close it:
- Cap request bodies.
express.json({ limit: "100kb" })or smaller; Express's default is 100 KB, but many apps raise it. Our own services cap bodies at 4 to 256 KB per route. - Don't count on
.max()in zod 3. We triedz.array(z.string()).max(100)on a million bad items: zod 3 still checked every item and used 280 MB. Check the length yourself before zod sees it, for exampleArray.isArray(v) && v.length > 100→ reject. - Use zod 4.6.6 or later in your own code. Add
"zod": "^4.6.6"to your own dependencies; x402 keeps its own zod 3 copy, and your code gets the fixed one.
Facilitator operators receive verify and settle requests from other people's servers. If they validate those bodies with zod 3, the same advice applies to them.
When it goes away
The warning disappears once the x402 packages accept zod 4. The latest versions on 2 November 2026:
| Package | Version | zod |
|---|---|---|
| @x402/core, /evm, /extensions, /mcp | 2.29.0 | ^4.6.6 (fixed; 2.28.0 had ^3.24.2) |
| @coinbase/x402 | 2.1.0 | ^3.24.2 |
| @coinbase/cdp-sdk | 1.60.0 | ^3.25.76 |
| x402, x402-express (v1) | 1.2.0 | ^3.24.2 |
| mppx | 0.17.0 | ^4.6.7 (fixed) |
We asked Coinbase to move cdp-sdk to zod 4, or to accept ^3 || ^4 as abitype already does, in coinbase/cdp-sdk#863. Our services keep a weekly audit issue open that lists only zod 3 and the packages that pull it in, so a new advisory stands out at once.
Who still has zod 3
Any JavaScript or TypeScript x402 project that has one of these:
@x402/*2.28.0 or older. That is still most of them. Of the 542,160@x402/coredownloads npm counted for the last seven days (on 2 November 2026), 5.2% were 2.29.0, 30.7% were 2.28.0 and the rest were older. For@x402/fetch, the buyer side, 4.5% were 2.29.0. 2.29.0 was only out for part of that week, so this share should grow.@coinbase/x402or@coinbase/cdp-sdk, in any version. That covers sellers who use Coinbase's facilitator, and agents with a CDP wallet. There is no version without zod 3 yet.- The v1 packages
x402,x402-expressandx402-fetch1.2.0, unchanged since April 2026.
Agents and servers built on x402's Python or Go SDKs are not affected: zod is a JavaScript library. And as Where x402 runs zod shows, a red audit is not the same as an open door: x402's own code doesn't run zod on what buyers or sellers send. The advice in your own zod 3 is what closes the real gap.
Upgrading to 2.29.0
Moving our services from 2.27 and 2.28 to 2.29.0 took more than a version bump. Four things to check in your own project:
- Solana:
@solana/kit8.@x402/svm2.29.0 needs@solana/kit8 or later as a peer. If something else put kit 5 at the root (@coinbase/cdp-sdkdoes),npm installstops with ERESOLVE. Add"@solana/kit": "^8.6.0"to your own dependencies; cdp-sdk keeps its own copy. - Algorand: only the short network id.
@x402/avm2.29.0 accepts Algorand mainnet only as the CAIP-2 idalgorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73k(the first 32 characters of the genesis hash). 2.28.0 also took the whole hash,algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=. A seller that still offers the long id now gets an error when the 402 is built. GoPlausible's facilitator lists both ids. Buyers that look for the long id by exact match won't find a 2.29.0 seller's option, so match both. - Your own zod 4. If you move your own schemas to zod 4 too:
z.record(value)with one argument no longer works; writez.record(z.string(), value)..passthrough()and.describe()still work, and the MCP SDK takes zod 3.25 or 4. - The browser paywall.
@x402/paywall2.29.0 now escapes</script>in the URL and description itself (x402#3855). It is also a new build, so code that patches its bundle by text needs new search strings. Check that the patched page still parses: our own Solana page had a syntax error from such a patch.
How we checked
- Advisory data from the npm advisory API and OSV (GHSA-mrhx-c7xc-m3w5, CVE-2023-54404), on 26 October 2026.
- Dependency ranges from the npm registry's latest manifests of each package, on 26 October and again on 2 November 2026.
- Download shares from npm's per-version download counts for the last seven days (api.npmjs.org/versions), read on 2 November 2026.
- The zod calls read in the published code of
@x402/core(client, server, HTTP and schema bundles) and@x402/fetch. - The memory numbers:
@x402/core'sparsePaymentRequiredon anacceptsarray of N zeros, zod 3.25.76, Node 24, heap measured before and after one call.
Questions
Is my x402 server vulnerable because npm audit says high?
Not through x402 itself. In @x402/core 2.28.0 the only zod validation on the paid path is of the facilitator's answers to verify and settle, from the facilitator you configured. The payment header a buyer sends is decoded with JSON.parse, not zod, and Node limits all headers to 16 KB anyway. What can hurt you is zod 3 in your own code: an array schema without a maximum, fed a request body you didn't cap.
Should I run npm audit fix?
Not with --force. npm's suggested fix for this advisory is to move @coinbase/x402 to 0.0.0, @x402/evm, /svm, /express and /extensions to 0.0.1, and mppx to 0.8.19: old or empty releases. Payments stop working. Plain npm audit fix (without --force) is safe and fixes the other advisories it can.
When does the warning go away?
For the x402 packages, with @x402/* 2.29.0 (28 October 2026): they now require zod ^4.6.6. It stays as long as @coinbase/x402 and @coinbase/cdp-sdk require zod 3; they need to accept zod 4.6.6 or later, or ^3 || ^4 as abitype already does. We asked Coinbase in coinbase/cdp-sdk#863. On 2 November 2026 neither had a new release.
Does this affect Python or Go agents?
No. zod is a JavaScript library, and x402's Python and Go SDKs don't use it. The advisory only shows up in JavaScript and TypeScript projects.
What should I do in my own code?
Cap request bodies (express.json({ limit: '100kb' }) or smaller), check the length of arrays from callers before zod 3 sees them (its .max() still checks every item), and move your own code to zod 4.6.6 or later; zod 3 and zod 4 can sit side by side in one project.
Check an x402 endpoint before you pay it with x402 Doctor, and a transaction before you sign it with presign-guard.