MCPNews

The Model Context Protocol ecosystem, verified

Current spec 2026-07-28

Official Java SDK caps HTTP reads in both directions after two resource-exhaustion advisories

The MCP Java SDK published GHSA-4x8c-5vv7-973f (high) and GHSA-5q7x-232h-f834 (medium) on 2026-08-19, both CWE-770. Its three Servlet HTTP server transports buffered entire request bodies without a cap and never checked Content-Length, and its HTTP client transports accumulated SSE data lines into an unbounded buffer. Fixes landed the same afternoon across 2.0.1, 1.1.4 and 0.18.4.

The Model Context Protocol Java SDK published two advisories on 2026-08-19, one for its server transports and one for its client transports, and shipped the fixes across three release lines the same afternoon. Both are classed CWE-770, allocation of resources without limits, and neither carries a CVE ID.

The server-side advisory, GHSA-4x8c-5vv7-973f, is rated high at CVSS 7.5. All three Servlet-based HTTP transports in mcp-core (Streamable HTTP, Stateless Streamable HTTP, and SSE) read the incoming request body into memory in a loop with no maximum size, and none of them checked the Content-Length header. The advisory states that a client using chunked transfer encoding could therefore stream an arbitrarily large body past any size check a deployment thought it had, and that one unauthenticated POST was enough to exhaust the heap and raise OutOfMemoryError. It names two mitigating factors: the transports' existing Origin and Host allow-list, and any authentication implemented outside the SDK, both of which read headers and can reject a request before the body is read.

The client-side advisory, GHSA-5q7x-232h-f834, is rated medium at CVSS 6.5 and points the same weakness the other way. Both HTTP client transports parse Server-Sent Events through one shared subscriber, ResponseSubscribers.SseLineSubscriber, which accumulates every data: line into a StringBuilder and dispatches only when it sees a blank line. A server that never sends that blank line can grow the client's heap without limit at almost no cost to itself. Multi-line data: fields are valid SSE and are meant to be concatenated; what was missing was any cap. The advisory is explicit that the SDK had no equivalent of the frame-size limit its sibling SDKs carry, naming ReadBuffer.DEFAULT_MAX_FRAME_SIZE as the analogue that did not exist here. It affects both the long-lived GET event stream and inline SSE returned on a POST, because both funnel through the same subscriber. There is no code execution in either advisory.

The remediation is version-line specific: 2.0.1, 1.1.4, or 0.18.4, matching whichever line a deployment tracks. Pull request #1102 bounded the HTTP reads and #1103 did the same for stdio, which no advisory covers. The merges landed at 12:41Z and 12:53Z, the three releases between 13:44Z and 13:47Z, and the advisories at 14:26Z. Deployments that cannot upgrade are told to put a reverse proxy or gateway enforcing a request-body size limit in front of the server.

Version 2.0.1 also carries spec-conformance work beyond the security fixes: SSE event classification now follows the specification when the event field is missing, pagination stops on empty cursors, stateless servers behave correctly on unregistered handlers, and the release upgrades the conformance suite to 0.1.16 with Spring AI conformance at 2.0.0 GA. The 1.1.4 and 0.18.4 releases each contain nothing but the backported read bound.

Related publishers

How was this verified, and what are the sources?

Published · last verified · confidence 1.00.

  1. GHSA-4x8c-5vv7-973f, published 2026-08-19T14:26:23Z, high, CVSS 3.1 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H), CWE-770, no CVE assigned - states the Streamable HTTP, Stateless and SSE server transports in mcp-core "buffered the entire incoming request body into memory before parsing it, with no limit on how large that body could be", that all three "do not check the Content-Length header, and read the request body in a loop with no maximum size check", and that a chunked-transfer-encoding client "could stream an arbitrarily large body past any such check"; impact given as heap exhaustion and OutOfMemoryError from a single request; affected io.modelcontextprotocol.sdk:mcp-core >= 0.18.0 < 0.18.4, >= 1.0.0 < 1.1.4, and 2.0.0; names the transports' existing Origin/Host allow-list and external authentication as mitigating factors - accessed
  2. GHSA-5q7x-232h-f834, published 2026-08-19T14:26:26Z, medium, CVSS 3.1 6.5, CWE-400 and CWE-770, no CVE assigned - states HttpClientStreamableHttpTransport and HttpClientSseClientTransport parse SSE through the shared ResponseSubscribers.SseLineSubscriber, which "accumulates every data: line into an unbounded StringBuilder and only flushes/dispatches the event on a blank line", so a malicious server sending endless data lines with no terminator causes unbounded client heap growth; states "There is no analogue anywhere in this SDK of a frame-size cap (e.g. nothing resembling ReadBuffer.DEFAULT_MAX_FRAME_SIZE in other SDKs) applied to this buffer"; affects both the long-lived GET event stream and inline SSE on a POST response; explicitly no RCE and no server compromise - accessed
  3. java-sdk release v2.0.1, published 2026-08-19T13:47:03Z - lists "Bound HTTP server and client reads" (#1102) and "Bound STDIO server and client reads" (#1103) alongside spec-conformance fixes for SSE event classification with a missing event field (#913), pagination stopping on empty cursors (#954), stateless-server error behaviour on unregistered handlers (#800), and an upgrade of the conformance suite to 0.1.16 with Spring AI conformance at 2.0.0 GA (#1032) - accessed
  4. java-sdk releases v1.1.4 (published 2026-08-19T13:45:33Z) and v0.18.4 (published 2026-08-19T13:44:47Z) - each carries a single change, "Bound HTTP client and server reads (backported from #1102)", confirming the two maintenance lines received only the security fix - accessed
  5. java-sdk pull requests #1102 "Bound HTTP server and client reads" (merged 2026-08-19T12:41:21Z) and #1103 "Bound STDIO server and client reads" (merged 2026-08-19T12:53:08Z) - place the merges 105 and 93 minutes before the advisories were published - accessed

← All news