@modelcontextprotocol/sdk
Affected
- introduced
1.3.0, fixed1.32.0(semver)
Fixed versions
1.32.0
Fix
- Fixed version
1.32.0npm install @modelcontextprotocol/[email protected]
Advisory
Also known as: CVE-2026-111768
MCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation
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.0Fix
Upgrade to:
@modelcontextprotocol/sdk 1.32.0 or later@modelcontextprotocol/server 2.3.0 or laterUpgrading alone changes nothing. The patched versions add an McpServer option, maxToolInputElements, that is off by default. Make both of these changes:
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.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.
High Basis: The source's own band: HIGH
1.3.0, fixed 1.32.0 (semver)1.32.0
1.32.0npm install @modelcontextprotocol/[email protected]2.0.0, fixed 2.3.0 (semver)2.3.0
2.3.0npm install @modelcontextprotocol/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0