Client HttpTransport SSE buffer grows unbounded when server withholds the event delimiter

DoS: client HttpTransport SSE buffer (sseBuffer .= $chunk) grows unbounded when the server withholds the event delimiter.

mcp/sdk 14.08.2026
Severity
Low High Overridden
Upstream suggested High
Maintainer suggestion — not confirmed
CVSS
Not scored
No vector in FriendsOfPHP source
Affected shops
1
Demo · mcp/sdk 0.5.0–<0.7.1
Visibility
Visible to users
Set in Shopmon enrichment
Upstream listing is public

Summary

The HTTP client transport in mcp/sdk reads a Server-Sent Events stream incrementally and appends each 4 KiB chunk to an in-memory buffer ($this->sseBuffer .= $chunk) with no upper bound. The buffer is only flushed when an SSE event delimiter ("\n\n") appears.

A remote MCP server — the peer the client connects to — that streams response bytes without ever sending the delimiter makes $sseBuffer grow without limit until the client process exhausts its PHP memory_limit or is killed by the OS OOM-killer.

This is a denial-of-service against the MCP client: any server it talks to, or a network position that controls the server’s response body, can crash the client by withholding the event delimiter while streaming data.

What Shopmon recommends

Disable MCP_SERVER inside the shop .env if it is set, until mcp/sdk is outside >=0.5.0,<0.7.1.