NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · MCP TypeScript SDK

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

highCVSS 3.1 7.5GHSA-46jr-4wx8-v453

MCP TypeScript servers put no cap on the array elements and object keys they validated per request. One unauthenticated HTTP request inside the default 4 MiB body limit could exhaust memory and abort the process with `JavaScript heap out of memory`. Fixed in `@modelcontextprotocol/sdk` 1.32.0 and `@modelcontextprotocol/server` 2.3.0, but the protection is off until you set `maxToolInputElements`.

Published Oct 20, 2026 · Analysis Oct 21, 2026

What an attacker can do

During validation the server walked every array element and object key in the request. A request with millions of tiny elements fits within 4 MiB yet forces far larger allocations during validation, so the Node.js heap runs out and the process dies. Tools whose input schema contains an array or a record are the easiest target.

The attacker needs network access to the HTTP endpoint and no credentials, unless you authenticate requests before they reach the SDK. The result is a denial of service: the MCP server goes down and every agent or client using it loses its tools until restart. A crash loop is possible if the attacker repeats the request. Servers that only use stdio are not affected.

Who is affected

Affected: @modelcontextprotocol/sdk 1.3.0 through 1.31.0 and @modelcontextprotocol/server 2.0.0 through 2.2.0. You are exposed if clients you do not fully trust can reach your server over HTTP.

npm ls @modelcontextprotocol/sdk @modelcontextprotocol/server

Risk is highest for McpServer tools that take arrays or records as input.

@modelcontextprotocol/sdk

Ecosystem
npm
Affected
>= 1.3.0, < 1.32.0
Fixed in
1.32.0
Check
npm ls @modelcontextprotocol/sdk

@modelcontextprotocol/server

Ecosystem
npm
Affected
>= 2.0.0, < 2.3.0
Fixed in
2.3.0
Check
npm ls @modelcontextprotocol/server

How to fix it

Upgrade to @modelcontextprotocol/sdk 1.32.0 (1.x) or @modelcontextprotocol/server 2.3.0 (2.x).

Upgrading alone changes nothing. Also make these changes:

  • Set maxToolInputElements just above the largest input your tools need, for example new McpServer(info, { maxToolInputElements: 10_000 }). A call over the limit gets an isError: true result.
  • Lower the request size limit. 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.

Without an upgrade, do the second change alone. maxRequestBodySize needs @modelcontextprotocol/sdk 1.30.1 or @modelcontextprotocol/server 2.1.0. On older versions, use a reverse proxy to limit body size.

How to tell if you were hit

Look for server processes that exit with JavaScript heap out of memory, repeated restarts of the MCP service, and unusually large POST bodies (close to 4 MiB) on the MCP endpoint in reverse proxy or access logs. The advisory lists no other indicators.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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: 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.

Credited to root-Brainoverflow.

Questions

Does upgrading to 1.32.0 or 2.3.0 fix CVE-2026-111768 by itself?

No. The patched versions add maxToolInputElements, which is off by default. You must set it and lower the request body size limit.

Do I need credentials to trigger it?

No, unless you authenticate requests before they reach the SDK. A single request within the default 4 MiB limit is enough.

Are stdio MCP servers affected?

No. The advisory says stdio-only servers are not affected. The risk is servers that untrusted clients reach over HTTP.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

Coverage on the Beam blog

More MCP TypeScript SDK vulnerabilities

All MCP TypeScript SDK entries