CVE-2026-53965: MCP PHP SDK: client HttpTransport SSE buffer (sseBuffer .= chunk) grows unbounded when server withholds the event delimiter
(updated )
The HTTP client transport in mcp/sdk reads a Server-Sent-Events (SSE) response
stream incrementally and appends each 4 KiB chunk to an in-memory buffer
($this->sseBuffer .= $chunk;) with no upper bound. The buffer is only ever
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
"\n\n" delimiter makes $sseBuffer grow without limit until the client process
exhausts its PHP memory_limit (fatal “Allowed memory size … exhausted”) 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.
References
- github.com/FriendsOfPHP/security-advisories/blob/master/mcp/sdk/CVE-2026-53965.yaml
- github.com/advisories/GHSA-7m52-jw36-44r3
- github.com/modelcontextprotocol/php-sdk/releases/tag/v0.7.1
- github.com/modelcontextprotocol/php-sdk/security/advisories/GHSA-7m52-jw36-44r3
- nvd.nist.gov/vuln/detail/CVE-2026-53965
Code Behaviors & Features
Detect and mitigate CVE-2026-53965 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →