x402 security · October 2026

Every x402 project fails npm audit

Frits Zwager, Fizzl · checked on 26 October 2026 against @x402/core 2.28.0, @coinbase/x402 2.1.0 and @coinbase/cdp-sdk 1.60.0 · updated 28 October 2026 for @x402/* 2.29.0 and 2 November 2026

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.

7.5CVSS, high: GHSA-mrhx-c7xc-m3w5 (CVE-2023-54404)
<4.6.6every zod version before 4.6.6; zod 3 has no fixed release
1place x402's paid path runs zod on outside data: the facilitator's answer
309 MBmemory zod 3 used on one 2 MB array of bad items

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 arrayJSON sizeMemory usedTime
10,00020 KB4 MB33 ms
100,0000.2 MB39 MB121 ms
500,0001.0 MB152 MB0.8 s
1,000,0002.0 MB309 MB1.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:

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:

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:

PackageVersionzod
@x402/core, /evm, /extensions, /mcp2.29.0^4.6.6 (fixed; 2.28.0 had ^3.24.2)
@coinbase/x4022.1.0^3.24.2
@coinbase/cdp-sdk1.60.0^3.25.76
x402, x402-express (v1)1.2.0^3.24.2
mppx0.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:

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:

How we checked

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.