Repository navigation
fix: clear the zod, MCP SDK, and body-parser advisory drift - #359
Conversation
…c-m3w5 GHSA-mrhx-c7xc-m3w5 (high) covers Zod's array validation below 4.6.6. Since its October 23 update it reports the zod@4.0.5 that @dynamic-labs-sdk/client and @dynamic-labs/wallet-book pin exactly, so the wallet-only npm consumer, which must audit clean, failed. The newest @dynamic-labs-sdk/client (1.45.0) still pins 4.0.5. The verifier's override set and all three README blocks gain "zod": "4.6.7", a minor-level move inside Zod 4. Nothing else in the wallet graph, including the AA path, needs Zod 3, so it is safe as a global Bun override. The README tells npm applications with their own Zod 3 dependency, such as Reown under wagmi, to scope it instead. Co-authored-by: Cursor <cursoragent@cursor.com>
Generated apps now also report GHSA-mrhx-c7xc-m3w5 (high) through the zod@3.22.4 that @reown/appkit-wallet pins under wagmi's WalletConnect connector. Reown's newest release still pins it and Zod has no fixed 3.x, so the template cannot override it without moving Reown onto Zod 4. The note claiming decode-uri-component was the only remaining finding now lists both. Co-authored-by: Cursor <cursoragent@cursor.com>
Fresh installs already resolved fixed releases, but ^1.23.0 and ^4.0.5 let an existing lockfile keep @modelcontextprotocol/sdk below 1.32.0, where GHSA-46jr-4wx8-v453 lets one HTTP request exhaust server memory, and zod below 4.6.6. The floors move to ^1.32.0 and ^4.6.6. A root zod override keeps the workspace on one copy, since Dynamic still pins 4.0.5 and mcp-zod-lock requires the SDK to share mcp-server's zod. bun.lock moves only the SDK to 1.32.2 and zod to 4.6.7. The SDK range test now pins the advisory floor. Co-authored-by: Cursor <cursoragent@cursor.com>
GHSA-27r3-jxmh-p828 (high, published October 23) covers body-parser below 1.20.9: a compressed body followed by trailing bytes can raise an uncaught exception that terminates the process, before routing. Express 4 accepts body-parser ~1.20.5, so no floor here can move an existing lockfile off a vulnerable copy. Both transports now pass inflate: false, the advisory's workaround, so an encoded body gets a 415 before any decompression stream exists. The SDK's client transports send uncompressed JSON. The Brotli note for this release said Express inflates gzip and deflate, which is no longer true. Co-authored-by: Cursor <cursoragent@cursor.com>
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit 793cc0a. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #359 +/- ##
=======================================
Coverage 96.53% 96.53%
=======================================
Files 81 81
Lines 5563 5563
=======================================
Hits 5370 5370
Misses 193 193
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
This is a tightly scoped advisory fix with patch changesets for each affected package. It raises the MCP SDK and zod floors, adds a root zod override, documents a consumer zod override, and turns off request-body inflation on both mcp-server HTTP transports, with tests that check for a 415. I found no correctness or security regressions; the wallet stdio-only guard and SSE session binding are untouched. The only notes are non-blocking.
Findings: 0 blocking | 5 non-blocking | 1 posted inline
Blockers
- None at the file/PR level.
Non-blocking
- The Cursor review pass produced no output (
cursor-review.mdwas empty). Codex reported no material issues, and I agree. - Bun consumers who also install
@reown/appkit-wallethave no scoped option. The README says Bun cannot scope overrides, so they are left with two choices: force Reown onto Zod 4, which it does not declare support for, or keep the zod finding. Consider saying so explicitly in the Bun block, rather than only in the npm-scoping sentence, so Bun users of wagmi/WalletConnect see the trade-off. - The
inflate: falsemitigation rests on the advisory's documented workaround, not on a local reproduction of the crash (the PR says so openly). The new tests confirm the 415 and that/healthstill responds, which is what this change can control. A short note in the mcp-server README about rejecting compressed request bodies could save HTTP-transport users some debugging, since this is a behavior change. - The root
zod: 4.6.7override is safe today because the lockfile previously held a singlezod@4.0.5with no Zod 3 copy in the workspace. If a workspace package ever adds a Zod 3 dependency, this override will silently move it to Zod 4.mcp-zod-lockpartly guards this, so it is worth keeping in mind when the override is removed. - 1 suggestion(s)/nit(s) flagged inline on specific lines.
| this.app = express(); | ||
| this.app.use(express.json()); | ||
| // No compressed request bodies: body-parser's decoder can crash the process (GHSA-27r3-jxmh-p828). | ||
| this.app.use(express.json({ inflate: false })); |
There was a problem hiding this comment.
[nit] Looks correct: body-parser 1.x answers 415 for any non-identity Content-Encoding when inflate is false, before it creates a decompression stream. Requests whose content type isn't JSON skip express.json and reach the SDK transport, which reads the raw body without inflating it, so they get no decompression path either. Consider linking the advisory ID in the README or changelog alongside this comment so the behavior change is easy to find.
Re-running the release smokes against today's advisory data shows that the green checks on #358 are stale. Two advisories reached npm's audit data after those checks ran:
GHSA-mrhx-c7xc-m3w5(high, Zod array validation below4.6.6) was updated on October 23 at 18:26 UTC and now reports thezod@4.0.5that Dynamic pins and thezod@3.22.4that Reown pins. On the Version Packages #358 head,bun run test:sei-global-wallet-releasefails because the wallet-only npm consumer, which must audit clean, reportszod. Everycreate-seiapp also reports a new high; that smoke stays green only because registry-mode audits are report-only.GHSA-27r3-jxmh-p828(high, published October 23 at 20:53 UTC) coversbody-parserbelow1.20.9, which bothmcp-serverHTTP transports parse requests with.mcp-serveralso declared floors (@modelcontextprotocol/sdk ^1.23.0,zod ^4.0.5) that let an in-place upgrade keep releases inside the SDK advisories published October 6–20. A fresh install was already clean.Changes
One commit per fix, so each can be reviewed or dropped on its own.
sei-global-wallet: add"zod": "4.6.7"to the verifier'sbaseSafeOverridesand all three README override blocks. The README notes that the override is global, so npm applications with their own Zod 3 dependency (such as Reown under wagmi) should scope it to@dynamic-labs-sdk/clientand@dynamic-labs/wallet-book. New patch changeset.create-sei: the pending 2.0.2 note now lists the Reownzodfinding next todecode-uri-componentinstead of calling the latter the only one left. No override reaches it: Reown 1.8.24 still pinszod@3.22.4, and Zod has no fixed 3.x.mcp-serverfloors:@modelcontextprotocol/sdk^1.32.0andzod^4.6.6. A rootzod: 4.6.7override keeps the workspace on one copy, whichmcp-zod-lockrequires while Dynamic pins 4.0.5.bun.lockmoves only the SDK (1.30.0 → 1.32.2) and zod (4.0.5 → 4.6.7). The SDK range test now pins the advisory floor.mcp-servercompressed bodies: both HTTP transports passexpress.json({ inflate: false }), the advisory's documented workaround, so an encoded request body gets a 415 whicheverbody-parseran existing lockfile holds. Express 4 acceptsbody-parser ~1.20.5, so no floor could do this. It is a behavior change for a client that compresses request bodies; the SDK's client transports do not. The pending Brotli note's sentence about Express inflating gzip and deflate is updated to match.Verification
bun run test:sei-global-wallet-release(full run) fails on the Version Packages #358 head withzod (GHSA-mrhx-c7xc-m3w5)and passes on this branch. The wallet-only npm consumer audits clean, the full npm consumer reports only the three waivedstream-jsonadvisories, and the Bun AA consumer stays within its waiver withzodno longer reported.bun run check,bun run build,bun run test(626mcp-servertests, 48 script tests, and the other package suites), andbun run lint:pack:allpass on Bun 1.4.4 and Node 26.12.1./health. Both fail against the previousexpress.json(), which answers 400.inflate: falsechange rests on the advisory's description and workaround, not a local reproduction.mcp-server's new ranges audits clean. For an app that also installs@reown/appkit-wallet, the scoped npmzodoverride resolves Dynamic to 4.6.7 while Reown keeps 3.22.4, as the README describes.The release plan is unchanged:
create-sei2.0.2,mcp-server1.0.2, andsei-global-wallet2.0.2, all patch.