---
id: "CVE-2026-111768"
kind: "vulnerability"
aliases: ["CVE-2026-111768", "GHSA-46jr-4wx8-v453"]
title: "MCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "@modelcontextprotocol/sdk", "fixed": ["1.32.0"], "affected": ">= 1.3.0, < 1.32.0", "ecosystem": "npm"}, {"name": "@modelcontextprotocol/server", "fixed": ["2.3.0"], "affected": ">= 2.0.0, < 2.3.0", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["ai-tooling", "cwe-770", "http-transport", "mcp", "node.js", "self-hosted", "typescript"]
not_affected_if: ["auth-required", "no-array-or-record-tool-inputs", "patched-version", "stdio-only"]
published_at: "2026-10-20T20:06:35+00:00"
first_seen_at: "2026-10-23T19:11:32+00:00"
updated_at: "2026-10-23T20:56:10+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-46jr-4wx8-v453", "first_seen_at": "2026-10-23T19:11:32+00:00"}]
---

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

The MCP TypeScript SDK did not limit how many array elements and object keys it validated per HTTP request, so one request under the default 4 MiB body limit can exhaust server memory and crash the Node process with an out-of-memory abort. An unauthenticated remote client can trigger it on any HTTP MCP server that exposes tools with array or record inputs.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:@modelcontextprotocol/sdk affected >= 1.3.0, < 1.32.0 fixed 1.32.0
- npm:@modelcontextprotocol/server affected >= 2.0.0, < 2.3.0 fixed 2.3.0

## How to check

Check the installed version: npm ls @modelcontextprotocol/sdk @modelcontextprotocol/server
Affected if sdk is 1.3.0 to 1.31.0 or server is 2.0.0 to 2.2.0, and the server uses HTTP transport with McpServer tools that take arrays or records.

## Fix

Upgrade @modelcontextprotocol/sdk to 1.32.0 or @modelcontextprotocol/server to 2.3.0, then set maxToolInputElements (e.g. new McpServer(info, { maxToolInputElements: 10_000 })) and lower maxRequestBodySize on the transport or createMcpHandler(). If you cannot upgrade, set maxRequestBodySize (needs sdk 1.30.1 or server 2.1.0) or enforce a body limit at a reverse proxy.

## Timeline

- 2026-10-23T19:11:32+00:00 ghsa https://github.com/advisories/GHSA-46jr-4wx8-v453

## From the sources

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

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
