{"id":"EEF-CVE-2026-114213","summary":"WebSocket 1-byte continuation frames bypass `max_fragmented_message_size` in Bandit","details":"## Summary\n\nAllocation of Resources Without Limits or Throttling vulnerability in the WebSocket fragment reassembly of mtrudel bandit allows an unauthenticated remote attacker to exhaust server memory via a fragmented message made of many 1-byte continuation frames.\n\n`Bandit.WebSocket.Connection` checks `max_fragmented_message_size` against the payload bytes received, but keeps every non-final continuation frame as a new list cell around its own binary, and nothing limits the number of fragments. A 1-byte fragment costs 7 bytes on the wire but about 150 to 170 bytes of server memory, so one connection can hold about 150 times the configured limit, roughly 1.2 to 1.4 GB at the default 8 MB. Ping frames between fragments keep the connection alive past the idle timeout.\n\nThis issue affects bandit: from 1.11.0 before 1.14.0.\n\n## Details\n\n**1. Byte-only limit.** In `Bandit.WebSocket.Connection` (`lib/bandit/websocket/connection.ex`), the fragment limit is checked against `fragment_size`, which only adds up payload bytes (`IO.iodata_length(frame.data)`).\n\n**2. Per-fragment accumulation.** Each non-final continuation frame is stored as a new cons cell around its own binary, `[connection.fragment_frame.data | frame.data]`. Only zero-length fragments are kept out, so 1-byte fragments are accepted. Each costs 7 bytes on the wire but keeps about 150 to 170 bytes in memory. Against 1.12.5, 1M fragments kept about 169 MB and 3M kept about 450 MB, growing linearly, and about 56 MB of traffic reaches the 8 MB payload cap.\n\n**3. Kept alive.** Ping frames sent between fragments are handled by `handle_control_frame` without touching the fragment state, so they keep the connection alive past the idle timeout.\n\n## Proof of concept\n\n1. Run Bandit with default settings and a WebSock that accepts every connection.\n2. Complete the WebSocket upgrade and send a non-final text frame with a 1-byte payload.\n3. Send 500,000 masked non-final continuation frames with 1-byte payloads, 3.5 MB in all.\n4. Send a Ping. The server answers with a Pong, and BEAM memory has grown by about 82 MB while the message is still far below the 8 MB cap.\n\n## Impact\n\nAn unauthenticated client can make one WebSocket connection hold about 150 times `max_fragmented_message_size` in server memory (about 82 MB for 3.5 MB of traffic in the reporter's test). This affects any Bandit server that accepts WebSocket upgrades with default settings, including Phoenix LiveView and Channels apps.\n\n## Workarounds\n\nLower `websocket_options: [max_fragmented_message_size: ...]` to the largest fragmented message the application needs, for example `65_536`. Memory per connection stays at about 150 times this limit, so a lower limit lowers the ceiling.","aliases":["CVE-2026-114213","GHSA-cpx7-qf6w-jc63"],"modified":"2026-10-26T13:56:06.589699180Z","published":"2026-10-26T13:30:58.262Z","database_specific":{"cpe_ids":["cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"],"cwe_ids":["CWE-770"],"capec_ids":["CAPEC-130"]},"references":[{"type":"ADVISORY","url":"https://github.com/mtrudel/bandit/security/advisories/GHSA-cpx7-qf6w-jc63"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-114213.html"},{"type":"WEB","url":"https://github.com/mtrudel/bandit/commit/21612c7c7b1ce43eccd36d3af3a2299d23513667"},{"type":"FIX","url":"https://github.com/mtrudel/bandit/commit/220b9dfd27f9a21305be2afc75cbe585ddc24e7a"},{"type":"PACKAGE","url":"https://hex.pm/packages/bandit"}],"affected":[{"package":{"name":"bandit","ecosystem":"Hex","purl":"pkg:hex/bandit"},"ranges":[{"type":"SEMVER","events":[{"introduced":"1.11.0"},{"fixed":"1.14.0"}]}],"versions":["1.11.0","1.11.1","1.12.0","1.12.1","1.12.2","1.12.3","1.12.4","1.12.5","1.13.0","1.13.1"],"database_specific":{"source":"https://cna.erlef.org/osv/EEF-CVE-2026-114213.json"}},{"ranges":[{"type":"GIT","repo":"https://github.com/mtrudel/bandit","events":[{"introduced":"21612c7c7b1ce43eccd36d3af3a2299d23513667"},{"fixed":"220b9dfd27f9a21305be2afc75cbe585ddc24e7a"}]}],"versions":["1.13.1","1.13.0","1.12.5","1.12.4","1.12.3","1.12.1","1.12.0","1.11.1","1.11.0"],"database_specific":{"source":"https://cna.erlef.org/osv/EEF-CVE-2026-114213.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"}],"credits":[{"name":"Peter Ullrich","type":"REPORTER"},{"name":"Mat Trudel","type":"REMEDIATION_DEVELOPER"},{"name":"Jonatan Männchen / EEF","type":"ANALYST"}]}