CVE-2026-111768: Model Context Protocol TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation

Published Oct 20, 2026
·
Updated

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

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: 10000 }). 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.

Other sources

The Model Context Protocol TypeScript SDK provides TypeScript client and server implementations of the Model Context Protocol. From 1.3.0 until 1.32.0 in @modelcontextprotocol/sdk and from 2.0.0 until 2.3.0 in @modelcontextprotocol/server, HTTP servers did not enforce a limit on the number of array elements and object keys validated in one request. The affected surface is validation of HTTP requests containing arrays or object keys. The trigger is an array-element or object-key validation workload large enough to exhaust memory while remaining within the request size limit. A single request within the default 4 MiB limit can terminate the process with JavaScript heap exhaustion. No credentials are required unless the application authenticates before SDK processing. Tools accepting arrays or records carry the greatest risk. stdio-only servers do not expose the HTTP request path. Upgrading alone does not enable the new validation bound. Operators must configure both a tool-input element bound and an appropriate request body size limit. This issue is fixed in @modelcontextprotocol/sdk 1.32.0 and @modelcontextprotocol/server 2.3.0.

— MITRE

Affected Software

2 affected componentsFixes available
npm/@modelcontextprotocol/server>=2.0.0<2.3.0
2.3.0
npm/@modelcontextprotocol/sdk>=1.3.0<1.32.0
1.32.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@modelcontextprotocol/server to a version that resolves this vulnerability.

    Fixed in 2.3.0
  2. Upgrade

    Upgrade npm/@modelcontextprotocol/sdk to a version that resolves this vulnerability.

    Fixed in 1.32.0
  3. Upgrade

    Upgrade @modelcontextprotocol/sdk to a version that resolves this vulnerability.

    Fixed in 1.32.0
  4. Upgrade

    Upgrade @modelcontextprotocol/server to a version that resolves this vulnerability.

    Fixed in 2.3.0
  5. Configuration

    Enable the maxToolInputElements option and set it just above the largest tool input required; for example, use new McpServer(info, { maxToolInputElements: 10_000 }).

    McpServer maxToolInputElements = 10_000
  6. Configuration

    Set maxRequestBodySize to the request size your tools need, lowering the default 4 MiB limit where appropriate. If the request body is parsed separately, such as with express.json() or Fastify, set that parser's limit as well.

    HTTP transport or createMcpHandler() request parser maxRequestBodySize = An appropriate limit for the tools

Event History

Oct 20, 2026
Advisory Published
via GitHub·08:06 PM
Data Sourced
via GitHub·08:06 PM
DescriptionSeverityWeaknessAffected Software
Nov 5, 2026
CVE Published
via MITRE·09:22 PM
Data Sourced
via MITRE·09:22 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Servers reachable over HTTP by clients you do not fully trust are affected. Risk is highest for McpServer tools that accept an array or record as input; stdio-only servers are not affected.

2

Does an attacker need credentials or user interaction?

No credentials or user interaction are required when the attacker can reach the server over HTTP. Credentials are needed only if requests are authenticated before reaching the SDK.

3

Will upgrading automatically enable protection?

No. The patched versions add the McpServer maxToolInputElements option, but it is disabled by default, so upgrading alone does not change the behavior.

4

What configuration change is required after upgrading?

Set maxToolInputElements to a value just above the largest input your tools require, such as new McpServer(info, { maxToolInputElements: 10_000 }). The limit counts both array elements and object keys in a call's arguments.

5

Which package versions need remediation?

Affected versions are @modelcontextprotocol/sdk 1.3.0 through 1.31.0 and @modelcontextprotocol/server 2.0.0 through 2.2.0. Upgrade the SDK to 1.32.0 or later, or the server package to 2.3.0 or later, and configure the input-element limit.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203