CVE-2026-111768
MCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation
Description
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/sdk1.3.0 through 1.31.0@modelcontextprotocol/server2.0.0 through 2.2.0
Fix
Upgrade to:
- 1.x:
@modelcontextprotocol/sdk1.32.0 or later - 2.x:
@modelcontextprotocol/server2.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:
- Set
maxToolInputElementsjust above the largest input your tools need, for examplenew McpServer(info, { maxToolInputElements: 10_000 }). It counts array elements and object keys in a call's arguments. A call over the limit gets anisError: trueresult. - Lower the request size limit to what your tools need. The option covers tool arguments only, and the size limit covers everything else. Set
maxRequestBodySizeon the transport orcreateMcpHandler(). If you parse the body yourself, for example withexpress.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 Maven artifacts (3)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm.at.modelcontextprotocol » sdkvia npm @modelcontextprotocol/sdk | >= 1.3.0, < 1.32.0 | 1.32.0 |
| org.mvnpm.at.modelcontextprotocol » servervia npm @modelcontextprotocol/server | >= 2.0.0, < 2.3.0 | 2.3.0 |
| org.webjars.npm » modelcontextprotocol__sdkvia npm @modelcontextprotocol/sdk | >= 1.3.0, < 1.32.0 | 1.32.0 |
Blast radius
50% of the dependent artifacts (1) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 67 |
Most used dependents
- org.webjars.npm » angular__cli1 usages
- org.mvnpm.at.angular » cli0 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (2 packages) . See all on OSV
References
| Package | modelcontextprotocol/typescript-sdk | github.com |
| Web | modelcontextprotocol/typescript-sdk advisory GHSA-46jr-4wx8-v453 | github.com |
| Web | modelcontextprotocol/typescript-sdk pull request #2926 | github.com |
| Web | modelcontextprotocol/typescript-sdk pull request #2927 | github.com |
| Web | modelcontextprotocol/typescript-sdk commit 6d8dbc6 | github.com |
| Web | modelcontextprotocol/typescript-sdk commit fd26801 | github.com |
