Repository navigation
Patch MCP server memory exhaustion (GHSA-46jr-4wx8-v453) - #37
Merged
Merged
Conversation
@modelcontextprotocol/server 2.2.0 is in the affected range for the validation memory-exhaustion advisory. 2.3.0 adds the fix and 2.3.1 is the latest published release. Pin the dev client to 2.3.1 so both packages share one core, and set maxToolInputElements because the patched SDK leaves that limit off. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Chris <BitL8-ByteShort@users.noreply.github.com>
Verify fails on npm audit --audit-level=high because Vite 8.3.1 and its PostCSS dependency source-map-js 1.2.1 are in published high ranges. Pin Vite 8.3.5, which pulls PostCSS 8.5.31 and source-map-js 1.2.2. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Chris <BitL8-ByteShort@users.noreply.github.com>
BitL8-ByteShort
marked this pull request as ready for review
October 22, 2026 17:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
Dependabot alerts #5 and #6 flag GHSA-46jr-4wx8-v453: one HTTP request within the default body-size limit could exhaust server memory while the MCP SDK validated unbounded arrays and object keys. This moves the affected runtime package to a patched release and turns on the new argument cap, which the patched SDK leaves off.
The required Verify job also runs
npm audit --audit-level=high. That step was failing on two high findings that were already in the tree: Vite8.3.1and transitivesource-map-js1.2.1. Both are updated to patched versions so the gate is clear.Advisory and version bump
The MCP advisory covers two packages:
@modelcontextprotocol/sdk>= 1.3.0,< 1.32.01.32.0@modelcontextprotocol/server>= 2.0.0,< 2.3.02.3.0This repo does not depend on
@modelcontextprotocol/sdk. The direct dependency is@modelcontextprotocol/server2.2.0, which is inside the affected range. The latest published release is2.3.1(2026-10-05). Its own note is a@modelcontextprotocol/corebump; the validation limit landed in2.3.0. Both@modelcontextprotocol/serverand the devDependency@modelcontextprotocol/clientare now pinned to2.3.1, and the lockfile resolves a single@modelcontextprotocol/core@2.3.1.The client package is not named by this advisory. It moves with the server because the v2 SDK packages share one core and are released together. Leaving the client on
2.2.0would install a second core beside the server.2.3.0also refuses to share oneMcpServeracross connections. This process already passesserveStdioa factory that builds a new server per connection, which is the pattern that release keeps working. There is no MCP HTTP transport here, somaxRequestBodySizedoes not apply. The advisory states that stdio-only servers are not on the HTTP request path that triggers the exhaustion.Upgrading alone does not enable the new limit.
get_model_statustakes no arguments androute_tasktakes at mosttaskandmodality, so the server now setsmaxToolInputElements: 32. A call over that cap is answered withisError: truebefore schema validation. A normal two-field route call is unchanged.Audit gate
Verify / verify (24.x)failed only onnpm audit --audit-level=high. Tests had already passed. The report was:source-map-js1.0.0–1.2.1(GHSA-68fv-2mgg-jv7q), pulled in by PostCSS.vite8.3.0–8.3.2(launch-editor and dev-server advisories). npm's fix is8.3.5.Vite is now pinned to
8.3.5. That release depends onpostcss^8.5.30, and the lockfile resolves PostCSS8.5.31withsource-map-js1.2.2. Rolldown moves from1.2.11to1.2.15with it, which is the range Vite8.3.5requires. These are patch updates inside the existing major versions.Verification
npm ciinstalled from the updated lockfile.npm audit --audit-level=highreports 0 vulnerabilities.npm run verify(tsc --noEmit,node --test,vite buildwith Vite 8.3.5): 352 passed, 0 failed, 3 skipped. The skips are the existing OpenCode host checks (OpenCode is not installed in this environment).maxToolInputElementsis removed and passes with the cap set.npm run test:browser: 14 passed.Safety and compatibility
CONTRIBUTING.md.