High

MCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation

  • Disclosed: 20.10.2026
  • Updated: 20.10.2026 23:21

Summary

In affected versions, servers put no limit on how many array elements and object keys they validated in one request. One HTTP request within the default 4 MiB size limit could exhaust the server's memory, and the process aborted with JavaScript heap out of memory.

No credentials are needed, unless you authenticate requests before they reach the SDK.

Am I affected?

Yes, if clients you do not fully trust can reach your server over HTTP. The risk is highest for McpServer tools whose input contains an array or a record. stdio-only servers are not affected.

Affected versions:

  • @modelcontextprotocol/sdk 1.3.0 through 1.31.0
  • @modelcontextprotocol/server 2.0.0 through 2.2.0

What to do

Fix

Upgrade to:

  • 1.x: @modelcontextprotocol/sdk 1.32.0 or later
  • 2.x: @modelcontextprotocol/server 2.3.0 or later

Upgrading alone changes nothing. The patched versions add an McpServer option, maxToolInputElements, that is off by default. Make both of these changes:

  1. Set maxToolInputElements just above the largest input your tools need, for example new McpServer(info, { maxToolInputElements: 10_000 }). It counts array elements and object keys in a call's arguments. A call over the limit gets an isError: true result.
  2. Lower the request size limit to what your tools need. The option covers tool arguments only, and the size limit covers everything else. Set maxRequestBodySize on the transport or createMcpHandler(). If you parse the body yourself, for example with express.json() or Fastify, set that parser's limit.

If you cannot upgrade yet, make the second change. maxRequestBodySize needs @modelcontextprotocol/sdk 1.30.1 or @modelcontextprotocol/server 2.1.0. Below that, use a reverse proxy.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @modelcontextprotocol/sdk >= 1.3.0, < 1.32.0 1.32.0
npm package @modelcontextprotocol/server >= 2.0.0, < 2.3.0 2.3.0

References

CVSS score 7.5/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness (CWE)
CWE-770
Platform
npm
Package
@modelcontextprotocol/sdk, @modelcontextprotocol/server
Disclosed
20.10.2026
Updated
20.10.2026 23:21

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-46jr-4wx8-v453 - CC BY 4.0

Vulnerability history: @modelcontextprotocol/server

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
10.2026 10.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 2
  • Medium 1

Disclosures per year

  1. 2026: 3
  1. MCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation this entry
    High · 7.5 CVE-2026-111768 >= 2.0.0, < 2.3.0 2.3.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.