Executive brief
Bandit is a web server for Elixir applications, often used with the Phoenix framework to handle web traffic and real-time WebSocket connections. A flaw in how it handles fragmented messages allows a remote attacker to overwhelm the server's processor by sending a large number of specially crafted small data packets. This can cause the server to become unresponsive, preventing legitimate users from accessing the service.
Technical details
An Inefficient Algorithmic Complexity (CWE-407) vulnerability exists in Bandit's WebSocket fragment reassembly logic. The 'oversize_message?/2' guard in 'lib/bandit/websocket/connection.ex' appends non-final continuation frames to a left-nested iolist and subsequently calls 'IO.iodata_length/1' on the entire accumulated buffer for every new frame. This results in quadratic (O(n^2)) computational complexity relative to the number of frames. While the 'max_fragmented_message_size' (default 8 MB) limits the total byte size, it does not limit the frame count; an attacker can send millions of 1-byte frames to pin a CPU core for extended periods. The issue is exacerbated because the WebSocket read timeout is an idle timeout and cannot preempt the synchronous reassembly work. The vulnerability is fixed in version 1.12.1.
Affected products
- mtrudel bandit >= 1.11.0, < 1.12.1
Timeline
- 2026-07-24: advisory: GHSA-vg8x-66vg-5pxh published
- 2026-07-24: patched: Fix committed in version 1.12.1