<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Sdk (&lt;= 0.5.0) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/sdk--0.5.0/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 19 Aug 2026 22:34:05 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/sdk--0.5.0/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>Unbounded Memory Growth in MCP PHP SDK SSE Client</title><link>https://feed.craftedsignal.io/briefs/2026-08-mcp-sdk-sse-dos/</link><pubDate>Wed, 19 Aug 2026 22:34:05 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-08-mcp-sdk-sse-dos/</guid><description>The MCP PHP SDK's HTTP transport fails to bound the in-memory buffer used for Server-Sent-Events, allowing a malicious server to trigger a denial-of-service via memory exhaustion.</description><content:encoded><![CDATA[<p>The <code>mcp/sdk</code> library, specifically the <code>HttpTransport</code> class in version 0.5.0, contains a vulnerability where incoming Server-Sent-Events (SSE) chunks are appended to an internal <code>$sseBuffer</code> without any length validation. The implementation relies exclusively on the presence of the <code>&quot;\n\n&quot;</code> delimiter to flush and clear the buffer. An attacker in control of the remote MCP server endpoint, or an actor capable of performing a man-in-the-middle attack on a plaintext connection, can withhold the required delimiter while streaming arbitrary data. This forces the client to continuously allocate memory to hold the accumulating response, eventually causing the process to reach its PHP <code>memory_limit</code> or triggering an OS-level OOM (Out-of-Memory) event. This vulnerability effectively allows a malicious or compromised MCP server to crash any connected client.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The victim client initializes an <code>Mcp\Client\Transport\HttpTransport</code> instance to communicate with an adversarial MCP server.</li>
<li>The client initiates an SSE connection to the server endpoint.</li>
<li>The server begins streaming the response but deliberately omits the SSE <code>&quot;\n\n&quot;</code> event delimiter.</li>
<li>The client's <code>HttpTransport::processSSEStream()</code> method is invoked in a loop, reading 4096-byte chunks from the active stream.</li>
<li>The library appends each incoming chunk directly to the private <code>$sseBuffer</code> string.</li>
<li>Because the buffer is only flushed upon identifying <code>&quot;\n\n&quot;</code> via <code>strpos</code>, the internal buffer grows monotonically with every network read.</li>
<li>The client process consumes heap memory until exceeding the configured PHP <code>memory_limit</code> or system-available RAM.</li>
<li>The client crashes with a fatal memory exhaustion error, resulting in a successful denial-of-service.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation results in the immediate denial-of-service of the client process. Any system or application relying on the <code>mcp/sdk</code> client is vulnerable to process crashes initiated by a malicious remote peer. This can lead to significant service disruption, especially in automated environments where the client is expected to maintain long-running connections to MCP servers.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to a patched version of <code>mcp/sdk</code> that implements a hard limit on the SSE buffer size.</li>
<li>If an immediate update is not available, implement a wrapper or middleware to monitor memory usage for MCP client processes and proactively terminate connections that exhibit anomalous memory growth.</li>
<li>Ensure that all MCP connections are configured to use TLS to prevent man-in-the-middle injection of malicious SSE streams.</li>
<li>Review and tighten the <code>memory_limit</code> configuration for PHP processes interacting with untrusted external servers to limit the impact of such memory-based exhaustion attacks.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>denial-of-service</category><category>sse</category><category>mcp</category><category>memory-exhaustion</category></item></channel></rss>