MCP PHP SDK: client HttpTransport SSE buffer (sseBuffer .= chunk) grows unbounded when server withholds the event delimiter
High severity. Published 19 August 2026. Update mcp/sdk to 0.7.1 or later: composer update mcp/sdk.
Which versions are affected?
| Package | Affected versions | Fixed in |
|---|---|---|
| mcp/sdk (opens in a new tab) | >= 0.5.0, < 0.7.1 | 0.7.1 |
What should you do?
Update every affected package you use to its fixed version, then check that nothing else in your project matches an advisory. To see which version you run, and whether anything is still affected:
composer show mcp/sdk
composer auditAdvisory details
| Severity | High |
|---|---|
| Published | |
| Updated | |
| CVE | CVE-2026-53965 (opens in a new tab) |
| GHSA | GHSA-7m52-jw36-44r3 (opens in a new tab) |
| Weakness | CWE-400, CWE-770 |
What the advisory says
Summary
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 memorylimit (fatal "Allowed memory size … exhausted") or is killed by the OS OOM-killer.
Source: GHSA-7m52-jw36-44r3 (opens in a new tab) in the GitHub Advisory Database (CC BY 4.0). Data from GitHub (opens in a new tab) as of .