mcp/sdk is vulnerable to Denial of Service (DoS)
53
Medium Risk
The MCP server request handling in mcp/sdk does not bound untrusted input on the Streamable HTTP transport and JSON-RPC parser. StreamableHttpTransport reads the entire POST body into memory with no size cap, MessageFactory accepts JSON-RPC batches of unbounded size and mishandles scalar or empty payloads, and a malformed or duplicated Mcp-Session-Id header reaches Uuid::fromString() and raises an uncaught exception. A remote client can exhaust server memory with an oversized body or huge batch, or crash request handling with a malformed session header. The fix enforces a maxBodyBytes cap with incremental reads, adds a maxBatchSize limit, rejects scalar/empty/non-object JSON-RPC input, and returns 400 for malformed or repeated session ID headers.
You are affected if you are using a version that falls within the vulnerable range and expose an MCP server over the Streamable HTTP transport.
mcp/sdk is vulnerable to Denial of Service (DoS) in versions 0.1.0 - 0.6.0.
Upgrade the mcp/sdk library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant