<?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/"><channel><title>Bandit (&gt;= 0.5.8, &lt; 1.11.0) — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/bandit--0.5.8--1.11.0/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 07 May 2026 03:36:13 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/bandit--0.5.8--1.11.0/feed.xml" rel="self" type="application/rss+xml"/><item><title>Bandit WebSocket permessage-deflate unbounded inflate leads to DoS</title><link>https://feed.craftedsignal.io/briefs/2026-05-bandit-websocket-inflate-dos/</link><pubDate>Thu, 07 May 2026 03:36:13 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-bandit-websocket-inflate-dos/</guid><description>Bandit versions 0.5.8 before 1.11.0 are vulnerable to denial of service when permessage-deflate is enabled, allowing an unauthenticated client to exhaust the BEAM's memory with a single, small, compressed WebSocket frame due to unbounded decompression.</description><content:encoded><![CDATA[<p>Bandit, a web server for the Erlang ecosystem, is vulnerable to a denial-of-service (DoS) attack. The vulnerability exists in versions 0.5.8 before 1.11.0 when the <code>permessage-deflate</code> WebSocket extension is enabled. An unauthenticated client can send a small, specially crafted compressed WebSocket frame that, when decompressed, expands to a significantly larger size, exhausting the server&rsquo;s memory. This occurs because the inflate step within Bandit lacks an output-size cap. This vulnerability affects applications that have explicitly enabled <code>compress: true</code> when upgrading a connection to a WebSocket, as stock Phoenix and LiveView apps default to <code>compress: false</code>. The attack occurs before any application-level code execution, making it difficult to mitigate without patching the Bandit library itself.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An unauthenticated client establishes a TCP connection to the Bandit server.</li>
<li>The client sends a WebSocket handshake request with <code>Sec-WebSocket-Extensions: permessage-deflate</code>.</li>
<li>The Bandit server negotiates the <code>permessage-deflate</code> extension if both <code>websocket_options.compress</code> and <code>connection_opts.compress</code> are true.</li>
<li>The client sends a WebSocket text frame with the RSV1 bit set to 1, indicating compressed data. The compressed frame is crafted to have a high compression ratio (e.g., 1024:1).</li>
<li>The Bandit server receives the compressed frame and begins decompression using <code>:zlib.inflate/2</code> in <code>lib/bandit/websocket/permessage_deflate.ex</code>.</li>
<li>The inflation process lacks any output-size limit, allowing the decompressed data to grow unbounded in memory.</li>
<li><code>IO.iodata_to_binary/1</code> materializes the entire decompressed payload into a single binary in the connection process&rsquo;s heap.</li>
<li>The server exhausts its available memory, leading to a denial-of-service condition as the BEAM process is OOM-killed or becomes unresponsive.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation results in a denial-of-service condition, potentially crashing the BEAM and rendering the Bandit-fronted application unavailable. A single, small compressed frame (~6MiB in the provided PoC) is sufficient to trigger the vulnerability, and concurrent connections will amplify the impact linearly. Applications that have enabled permessage-deflate for bandwidth savings are particularly at risk, as they may not be aware of the inherent unbounded-inflate DoS. This can affect any service using Bandit webserver which explicitly enables the <code>compress</code> option, leading to potential service outages.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Disable the <code>compress: true</code> option when calling <code>WebSockAdapter.upgrade/4</code> as a temporary workaround to mitigate the vulnerability.</li>
<li>Monitor process memory usage on systems running Bandit web servers, looking for sudden and significant increases, particularly after WebSocket connections are established. Consider creating a Sigma rule for this behavior based on process memory metrics.</li>
<li>Upgrade to Bandit version 1.11.0 or later once available to address the vulnerability with the fix suggested: &ldquo;thread a maximum-output-size through to inflate and either error out or return resumable chunks once exceeded, mirroring how the HTTP content-length path bounds reads via <code>:length</code>.&rdquo;.</li>
<li>Deploy the Sigma rule detecting WebSocket handshake with <code>permessage-deflate</code> to identify potentially vulnerable configurations.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>websocket</category><category>denial-of-service</category><category>erlang</category></item></channel></rss>