chore(deps): update dependency bandit to v1.14.1 [security] #639
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
security
technical improvement
UX Improvement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
local-it/mitgliederverwaltung!639
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/hex-bandit-vulnerability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
1.12.5→1.14.1HTTP/2 blocked-send deadlines reset on every WINDOW_UPDATE, letting a trickle pin stream processes indefinitely in Bandit
CVE-2026-105659 / EEF-CVE-2026-105659 / GHSA-69m6-wcv4-rwcf
More information
Details
Summary
Uncontrolled Resource Consumption vulnerability in mtrudel bandit allows an unauthenticated remote attacker to pin HTTP/2 stream processes indefinitely via a trickle of small
WINDOW_UPDATEframes. A stream whose response outruns the connection or stream send window blocks until the peer grants more window, and each block carries a 15 second deadline. Both deadlines restart whenever the peer makes partial progress.Bandit.HTTP2.Connection.finish_data/5re-queues a partially advanced send inpending_sendswith a freshexpires_at, so everyWINDOW_UPDATEon stream 0, and everySETTINGSframe, resets the clock.Bandit.HTTP2.Stream.send_data/3recurses on each streamWINDOW_UPDATEand re-arms a freshafter read_timeout. A peer that grants a few bytes every few seconds keeps the blocked stream process, its Plug state and any resource it holds mid-response alive for as long as it keeps dripping, and repeats this across streams and connections to exhaust server processes and memory.The two paths are independent. The stream-level block is reached on its own by widening the connection window with a large
WINDOW_UPDATEon stream 0 and shrinking the per-stream window with a smallSETTINGS_INITIAL_WINDOW_SIZE, so closing only the connection-level path leaves it exploitable.This issue affects bandit: from 1.4.0 before 1.13.0.
Details
1. Connection-level block (
lib/bandit/http2/connection.ex)A send that outruns the connection send window is queued in
pending_sendswith anexpires_atdeadline computed infinish_data/5as now plus@pending_send_timeout(15 seconds).expire_pending_sends/1drops any queued send whose deadline has passed whenever data arrives on the connection.do_pending_sends/2runs on everyWINDOW_UPDATEon stream 0 and on everySETTINGSframe (including an empty one, throughhandle_frame/3). When the granted window is smaller than the queued remainder, the leftover is re-queued throughfinish_data/5, which recomputesexpires_atfrom the current time instead of preserving the original deadline. Each partial advance therefore restarts the timer, and an emptySETTINGSframe restarts it without granting any window at all.2. Stream-level block (
lib/bandit/http2/stream.ex)send_data/3runs in the stream process. When the stream send window is exhausted it enters areceivethat waits for{:bandit, {:send_window_update, delta}}withafter stream.read_timeout(the struct default of 15 seconds, never overridden ininit/5). On each streamWINDOW_UPDATEit applies the delta and recurses intosend_data/3with the remainder, which re-enters the samereceivewith a freshaftertimeout. Each partial advance restarts the 15 second wait.For the stream-level block to be the one stuck, the stream window must be exhausted while the connection window has room. The peer controls both: a large
WINDOW_UPDATEon stream 0 opens the connection window, and a smallSETTINGS_INITIAL_WINDOW_SIZEshrinks every stream window. Closing only the connection-level path therefore leaves the stream-level path fully exploitable.3. Effect
The trickle also keeps the transport-level read timeout from firing, since the connection continuously receives valid frames. The blocked stream process, its Plug state, and anything it holds mid-response stay retained for as long as the peer keeps dripping, instead of being released after 15 seconds.
Proof of concept
Connection-level path:
pending_sends.WINDOW_UPDATEfor stream 0 with an increment of 1 every few seconds, or an emptySETTINGSframe. Each one re-queues the remainder with a fresh deadline, soexpire_pending_sends/1never expires it.Stream-level path:
WINDOW_UPDATEfor stream 0 so the connection window never blocks.SETTINGS_INITIAL_WINDOW_SIZEso each stream window is tiny.receiveinsend_data/3.WINDOW_UPDATEfor the stream with an increment of 1 at intervals shorter than 15 seconds. Each one re-arms a freshread_timeout.max_concurrent_streamsper connection, and across connections.Impact
A remote, unauthenticated peer requests a response larger than a send window, then drips tiny
WINDOW_UPDATEframes every few seconds. Each blocked stream process, with its Plug state and any upstream connection or file handle it holds, stays alive for as long as the trickle continues. Repeated across many streams and connections this exhausts server processes and memory.Workarounds
Disable HTTP/2 with
http_2_options: [enabled: false], which removes both vulnerable paths. Alternatively, terminate HTTP/2 at a reverse proxy that enforces its own send timeouts and speaks HTTP/1 to Bandit.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
Unvalidated HTTP/1 request-target authority lets a client choose conn.host and conn.port in Bandit
CVE-2026-105660 / EEF-CVE-2026-105660 / GHSA-v53v-9hvg-37jf
More information
Details
Summary
Improper Validation of Syntactic Correctness of Input vulnerability in mtrudel bandit allows an unauthenticated remote attacker to set
conn.hostandconn.portto values outside the RFC 3986 host grammar via the authority of an HTTP/1 absolute-form or authority-form request target. Bandit validates theHostheader and answers 400 when it is malformed, but when the request target carries its own authority that authority takes precedence, as RFC 9112 requires, andBandit.Pipeline.determine_host_and_port!/4inlib/bandit/pipeline.expasses it to the application unchecked. A request line such asGET http://good.example@evil.example/x HTTP/1.1with a validHostheader yields aconn.hostofgood.example@evil.example, and the same path admits NUL, DEL and non-ASCII bytes, invalid IP literals and ports outside 1..65535. The HTTP/1.0 clause needs noHostheader at all, andCONNECTplaces the unparsed port string inconn.port.Applications that build absolute URLs from
conn.host, such as throughPlug.Conn.request_url/1or Phoenix URL helpers, emit links whose authority the attacker chose. Message framing is unaffected, and no CR or LF can reachconn.host.This issue affects bandit: from 0.6.0 before 1.13.0.
Details
1. Request-target parsing (
lib/bandit/http1/socket.ex):erlang.decode_packet/3returns an absolute-form target as{:absoluteURI, scheme, host, port, path}and an authority-form (CONNECT) target as{:scheme, host, port}.resolve_request_target!/2unwraps both into a{scheme, host, port, path}tuple and forwardshostandportas received.validate_request_line!/2only rejects bytes at or below0x20and0x7F, so userinfo, delimiters, backslashes, bytes0x80to0xFF, invalid IP literals and out-of-range ports pass. ForCONNECT,portis the unparsed text after the first colon.2. Host selection (
lib/bandit/pipeline.ex)determine_host_and_port!/4has three clauses. The HTTP/1.1 clause callsrequired_host_header!/1, which parses theHostheader withBandit.Headers.parse_hostlike_header!/1and raises a 400 on a malformed value, and then discards that result whenevertarget_hostis set, returningto_string(target_host)andtarget_portinstead. The fallback clause used for HTTP/1.0 and forCONNECTreturns the target host and port directly and never consults theHostheader. The precedence itself follows RFC 9112 section 3.2.2; the defect is that the value which wins is the one never validated.3. Effect
build_conn!/6places the pair into theURIfrom whichPlug.Conn.Adapter.conn/5buildsconn.hostandconn.port. The application therefore sees host values Bandit rejects on every other route into the same field, and forCONNECTa binary wherePlug.Conn.port_number/0promises an integer, which makesPlug.Conn.request_url/1raise.Proof of concept
conn.hostandconn.port.GET http://good.example@evil.example/x HTTP/1.1followed byHost: good.exampleand an empty line. The response is 200 andconn.hostisgood.example@evil.example.GET http://ex\x00am.com/x HTTP/1.1(a NUL byte in the authority) orGET http://ex.com:99999/x HTTP/1.1. Both are accepted, with the NUL byte inconn.hostand 99999 inconn.port.Hostheader of an origin-form request instead. Bandit answers 400 for the NUL byte and the out-of-range port on 1.12.5, and for every payload once theHostgrammar tightening on main is released.GET http://good.example@evil.example/x HTTP/1.0with noHostheader, orCONNECT good.example@evil.example:443 HTTP/1.1. Both are accepted, and theCONNECTform leavesconn.portas the binary"443".Impact
An unauthenticated client can make the application see any host string and any port number as the request's authority, bypassing the validation applied to the
Hostheader. An application that builds absolute URLs fromconn.host, such as password-reset or verification links, emits links whose host the attacker chose.Workarounds
Add a plug ahead of any code that reads
conn.hostorconn.portthat comparesconn.hostagainst an allow-list of the hostnames the application serves, checks thatconn.portis an integer, and halts the request with a 400 response otherwise. Do not derive absolute URLs fromconn.hostuntil that check has passed.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
HTTP/2 inbound flow control is not enforced, letting a client queue unbounded DATA in stream processes in Bandit
CVE-2026-108525 / EEF-CVE-2026-108525 / GHSA-c3g7-2pg5-qvwh
More information
Details
Summary
Allocation of Resources Without Limits or Throttling vulnerability in the HTTP/2 implementation of mtrudel bandit allows an unauthenticated remote attacker to exhaust server memory via DATA frames sent past the advertised receive window. The attacker requests a response larger than the 65,535-byte initial window and withholds
WINDOW_UPDATE, so the stream process blocks while sending and stops reading, then floods small DATA frames on that stream. Every frame is queued in the stream's mailbox until the BEAM node runs out of memory.Bandit.HTTP2.Connection.handle_frame/3inlib/bandit/http2/connection.exforwards each DATA frame to the stream process without consulting the receive window, andBandit.HTTP2.FlowControl.compute_recv_window/2replenishes the window as data arrives rather than as it is consumed, and never answers a violation withFLOW_CONTROL_ERROR.This issue affects bandit: from 0.3.1 before 1.14.0.
Details
1. Connection-level window (
lib/bandit/http2/connection.ex,lib/bandit/http2/flow_control.ex)The
handle_frame/3clause for DATA frames sends the payload to the stream process before any window is checked. It then callscompute_recv_window/2, which subtracts the frame size and, once the window drops below 2^30, advertises aWINDOW_UPDATEback up to 2^31-1. A negative window is accepted, so a peer that overruns the window is never refused, and the window refills when data arrives rather than when it is consumed.2. Stream-level window (
lib/bandit/http2/stream.ex)The stream receive window is debited only when the stream process reads the DATA message, and it never rejects a violation either.
3. Accumulation
While
send_data/3waits for send window, its selectivereceivematches only window updates and resets, so DATA messages pile up unread in the mailbox. A streamWINDOW_UPDATEof 1 byte, sent at intervals under the 15-second send timeout, keeps the stream alive while the attacker floods 1-byte DATA frames.Proof of concept
WINDOW_UPDATE. The server sends one window's worth and the stream blocks insend_data/3.WINDOW_UPDATEwith an increment of 1 to keep the blocked send alive.FLOW_CONTROL_ERRORnorGOAWAYwhile its memory grows with every frame.Impact
An unauthenticated remote client can exhaust the memory of any Bandit server with HTTP/2 enabled by flooding DATA frames on a stream that is not reading its request body, such as one stalled sending a large response. The queued frames live in the BEAM node's memory, so exhausting it takes down every application on the node, not just the HTTP listener.
Workarounds
From 0.7.0, disable HTTP/2 with
http_2_options: [enabled: false], which removes the vulnerable path.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
SETTINGS and stream-0 WINDOW_UPDATE frames trigger quadratic work over blocked streams in Bandit
CVE-2026-108529 / EEF-CVE-2026-108529 / GHSA-j363-h72p-296m
More information
Details
Summary
Inefficient Algorithmic Complexity vulnerability in the HTTP/2 implementation of mtrudel bandit allows an unauthenticated remote attacker to exhaust server CPU via small SETTINGS or connection-level WINDOW_UPDATE frames. The attacker opens thousands of streams whose responses block on the connection send window, then sends cheap frames that each make the server walk the whole queue of blocked sends. In the reporter's run, with 3,000 blocked streams a single 9-byte SETTINGS frame took 133 ms to process.
do_pending_sends/2inlib/bandit/http2/connection.exretries every queued send and, before each retry, removes that entry from the queue withList.delete/2, so one frame costs O(n²) list operations for n blocked streams.max_concurrent_streamsdefaults to:infinity, so the attacker chooses n.This issue affects bandit: from 0.3.4 before 1.14.0.
Details
1. Blocked sends
A response that outruns the connection send window is queued in
pending_sends. Withmax_concurrent_streamsdefaulting to:infinityand no connection-levelWINDOW_UPDATEfrom the client, every one of n streams ends up queued.2. Trigger (
lib/bandit/http2/connection.ex)Every non-ACK SETTINGS frame and every
WINDOW_UPDATEon stream 0 callsdo_pending_sends/2. SETTINGS handling also sendsdeliver_send_window_updateto every stream even when the window delta is 0, so unread messages pile up in the mailboxes of blocked streams.3. Quadratic drain
do_pending_sends/2walks the queue and callsList.delete/2on the whole list before retrying each entry, putting it back at the front if the send is still blocked. One frame therefore costs O(n²) list operations, about 10^8 at n = 10,000.Proof of concept
WINDOW_UPDATE, so the responses queue inpending_sends.Impact
An unauthenticated remote client that keeps thousands of HTTP/2 response streams blocked makes each 9-byte SETTINGS or stream-0 WINDOW_UPDATE frame cost the server quadratic CPU work. A steady trickle of such frames keeps the connection process, and the scheduler running it, busy for as long as the attacker continues.
Workarounds
From 1.9.0, bound the number of streams a client can open, for example with
http_2_options: [default_local_settings: [max_concurrent_streams: 100]], which bounds the work each frame can cause. From 0.7.0, disabling HTTP/2 withhttp_2_options: [enabled: false]removes the vulnerable path.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
HTTP/2 cookie crumb join expands a small HPACK header block into an unbounded allocation in Bandit
CVE-2026-109584 / EEF-CVE-2026-109584 / GHSA-7gfj-7gvq-3xqj
More information
Details
Summary
Improper Handling of Highly Compressed Data (Data Amplification) vulnerability in the HTTP/2 implementation of mtrudel bandit allows an unauthenticated remote attacker to exhaust server memory via a small HPACK-compressed HEADERS block. The block stores one large
cookievalue in the HPACK dynamic table and then references it tens of thousands of times with 1-byte indexed fields. In the reporter's run, a 49 KB block made a server with default settings allocate a 183 MB cookie binary before any application code ran, and every concurrent stream can repeat the cost.Bandit.HTTP2.Connectioncaps only the compressed block (max_header_block_size), and its check of the decoded list againstmax_header_list_sizenever fires because that setting defaults to:infinity.combine_cookie_crumbs/1inlib/bandit/http2/stream.exthen joins every crumb into one binary.This issue affects bandit: from 0.3.3 before 1.14.0.
Details
1. Compression
The attacker's header block, split across HEADERS and CONTINUATION frames, stays under the 50,000-byte
max_header_block_size. It inserts one 4,058-bytecookieinto the 4,096-byte dynamic table, the largest value that fits, then references it about 45,000 times with 1-byte indexed representations.HPAX.decodereturns a list whose entries all point at the same binary, so decoding itself stays cheap.2. Missing decoded limit (
lib/bandit/http2/connection.ex,lib/bandit/http2/settings.ex)After decoding, the connection compares
header_list_size(headers)againstlocal_settings.max_header_list_size. That setting defaults to:infinity, and in Erlang term order every integer sorts below an atom, so the comparison never rejects a list. The limit is enforced only when an operator sets it.3. Expansion (
lib/bandit/http2/stream.ex)read_headerscallscombine_cookie_crumbs/1, which joins every crumb withEnum.map_join/3into a single binary of about 183 MB beforePlug.call/2runs.max_concurrent_streamsalso defaults to:infinity, so N streams allocate N times as much.Proof of concept
cookiestored in the dynamic table and then referenced about 45,000 times with indexed representations. The block is about 49 KB.END_HEADERSon the last.cookieheader of about 183 MB, and VM memory grows by about the same amount. Repeat on further streams to multiply it.Impact
An unauthenticated remote client can make any Bandit server with default HTTP/2 settings allocate a cookie binary thousands of times larger than the header block it sent, before any application code runs. Repeating it across concurrent streams exhausts the BEAM node's memory, taking down every application on the node.
Workarounds
On 1.12.2 and later, set a finite decoded header list limit, for example
http_2_options: [default_local_settings: [max_header_list_size: 65_536]], which resets the stream before the cookie crumbs are joined. From 0.7.0, disabling HTTP/2 withhttp_2_options: [enabled: false]removes the vulnerable path.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
WebSocket frames keep reaching the WebSock after a server-initiated close in Bandit
CVE-2026-110314 / EEF-CVE-2026-110314 / GHSA-2v5v-8f9v-xh85
More information
Details
Summary
Client-Side Enforcement of Server-Side Security vulnerability in the WebSocket connection handling of mtrudel bandit allows a remote client to keep running WebSock handler code after the server has stopped its connection, via data frames sent after ignoring the server's Close frame.
When a WebSock callback returns
{:stop, ...},Bandit.WebSocket.Connectioncallsterminate/2, sends Close and shuts down the write side, but keeps the connection process running in a:closingstate.handle_frame/3andhandle_info/3never check that state, so later frames still reachhandle_in/2and later messages reachhandle_info/2, with the state from the stop tuple, until the client sends Close, TCP drops or the idle timeout fires. A client refused ininit/1after a failed token check could still run an admin-only action.This issue affects bandit: from 0.5.1 before 1.14.0.
Details
1. Stop without close. In
Bandit.WebSocket.Connection,do_stop/4callsterminate/2, sends the Close frame and runsshutdown(:write). It then returns{:continue, %{connection | state: :closing}}, soBandit.WebSocket.Handlerkeeps the process alive.2. No state check.
handle_frame/3andhandle_info/3never checkconnection.state. Every later data frame still reacheshandle_in/2, and every later message still reacheshandle_info/2, with the state from the stop tuple.3. Client-controlled lifetime. The connection ends only when the client sends Close, TCP drops, or the idle timeout fires, and each client frame resets that timeout. All stops through
do_stopare affected:{:stop, :normal, ...},{:stop, {:shutdown, :disconnected}, ...}and{:stop, {:shutdown, :restart}, ...}, which is what Phoenix's:socket_drainreturns. A banned user who was kicked kept posting for longer than the idle timeout.Proof of concept
init/1returns{:stop, :normal, {4401, "unauthorized"}, state}for a wrong token, and whosehandle_in/2runs an admin-onlydelete_all_usersaction whenuser_idisadmin.?user_id=admin&token=wrong. The server callsterminate/2and sends a Close frame with code 4401.delete_all_users.handle_in/2runsdelete_all_usersasadmin.Impact
A remote client that ignores the Close frame can keep invoking a WebSock application's handlers after the application refused or ended its session, bypassing an authorization check in
init/1or a kick or ban. This affects WebSock applications that rely on{:stop, ...}to end a session.Workarounds
Mark the WebSock state as stopped whenever a callback returns
{:stop, ...}, and havehandle_in/2andhandle_info/2return{:ok, state}without acting while that mark is set.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
Client-chosen HPACK encoder table size is applied uncapped, growing per-connection state with every response in Bandit
CVE-2026-110499 / EEF-CVE-2026-110499 / GHSA-47x4-3fxf-82fr
More information
Details
Summary
Allocation of Resources Without Limits or Throttling vulnerability in the HTTP/2 implementation of mtrudel bandit allows an unauthenticated remote attacker to grow per-connection memory and CPU cost without bound via a large
SETTINGS_HEADER_TABLE_SIZE. Bandit resizes its HPACK encoder table to whatever size the client advertises, up to 2^32-1 bytes, and indexes response headers into it. Because responses carry distinct values such asdateorcontent-length, nothing is evicted and the table grows with every response for the life of the connection, while each lookup scans it linearly.The SETTINGS handling in
Bandit.HTTP2.Connection(lib/bandit/http2/connection.ex) passesremote_settings.header_table_sizetoHPAX.resize/2with no server-side cap, andencode_headersencodes every response header as:store. Serving N responses on one connection therefore costs O(N²) CPU in the connection process.This issue affects bandit: from 0.3.6 before 1.14.0.
Details
1. Table size (
lib/bandit/http2/connection.ex)On every SETTINGS frame,
Bandit.HTTP2.Connectionpasses the peer'sSETTINGS_HEADER_TABLE_SIZEstraight toHPAX.resize/2for the encoder table, accepting values up to 2^32-1. No server-side limit is applied.2. Indexing
encode_headersencodes every response header as:store, adding it to the dynamic table. Headers whose values differ per response (date,content-length,set-cookie,x-request-id, a reflectedlocation) produce new entries, and with a limit of about 4 GB none are evicted.3. Cost
HPAX's
lookup_by_headerscans the table linearly for each header it encodes, so every response costs more than the one before it. Serving N responses on one connection costs O(N²) CPU in the connection process, and the table holds every entry for as long as the connection stays open.Proof of concept
SETTINGS_HEADER_TABLE_SIZEof 4294967295 in the initial SETTINGS frame.Impact
An unauthenticated remote client that keeps an HTTP/2 connection busy with cheap requests makes every response on it progressively more expensive, because the encoder table it enlarged never shrinks. Holding several such connections open ties up server CPU and memory for as long as the attacker keeps them alive.
Workarounds
From 0.7.0, cap the requests one HTTP/2 connection may serve, for example with
http_2_options: [max_requests: 1000], so each connection and its encoder table is closed before the cost grows large. Alternatively, disable HTTP/2 withhttp_2_options: [enabled: false].Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
HTTP/1.1 chunked request bodies made of 1-byte chunks amplify memory use in Bandit
CVE-2026-111101 / EEF-CVE-2026-111101 / GHSA-jwh3-j29h-qfmw
More information
Details
Summary
Allocation of Resources Without Limits or Throttling vulnerability in the HTTP/1.1 chunked body reader of mtrudel bandit allows an unauthenticated remote attacker to exhaust server memory and CPU via a request body made of many 1-byte chunks.
The chunked reader in
lib/bandit/http1/socket.exkeeps every chunk as its own list cell and binary term untilIO.iodata_to_binary/1joins them, and nothing limits the number of chunks. The:lengthoption ofread_body/2counts only data bytes, so tiny chunks cost far more memory than their payload: 48 MB of 1-byte chunks grew one handler process to about 500 MB and took about 6 s of CPU. The route does not need to read the body, because on keep-alive connectionsensure_completed/1drains unread bodies through the same reader.This issue affects bandit: from 0.1.0 before 1.14.0.
Details
1. Per-chunk accumulation.
do_read_chunked_data!inlib/bandit/http1/socket.excollects chunks as[body | chunk], adding a cons cell and a binary term for every chunk.2. Byte-only limit.
:lengthlimits data bytes, not the number of chunks, so a body of1\r\nx\r\nchunks becomes an 8-million-element improper list beforeIO.iodata_to_binaryruns. Sending 48 MB of 1-byte chunks grew the handler heap to about 500 MB and used about 6 s of CPU. The same body as one 8 MB chunk peaked at about 16 MB and took 5 ms.3. No body read needed. On keep-alive connections,
ensure_completed/1drains unread bodies through the same path. Against a Plug that never callsread_body, the attack used about 417 MB.Proof of concept
Plug.Conn.read_body(conn, length: 1_000_000, read_length: 1_000_000).POST /withTransfer-Encoding: chunkedand a body of 1,000,000 chunks of1\r\nA\r\n, followed by0\r\n\r\n.read_bodyreturns the 1,000,000 body bytes, the handler process holds about 48 MB and BEAM memory has grown by about 55 MB, for 6 MB sent.Impact
An unauthenticated client can make a single HTTP/1.1 request hold many times its body size in server memory (about 48 MB for a 1 MB body in the reporter's test), and keep CPU busy while the chunks are joined. This affects any Bandit server that accepts HTTP/1.1 requests, whether or not its routes read the body.
Workarounds
From 0.7.0, a server whose clients and proxies all speak HTTP/2 can disable HTTP/1 with
http_1_options: [enabled: false], so that the vulnerable chunked body reader never runs.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
HTTP/2 StreamError recovery rolls back connection state and bypasses per-connection limits in Bandit
CVE-2026-111103 / EEF-CVE-2026-111103 / GHSA-2238-pgfc-w82m
More information
Details
Summary
Improper Cleanup on Thrown Exception vulnerability in the HTTP/2 handler of mtrudel bandit allows an unauthenticated remote attacker to bypass per-connection resource limits via a single TCP write that carries several frames, one of which raises a stream error.
When a frame raises
StreamErrorpartway through a chunk,Bandit.HTTP2.Handler.handle_data/3sends RST_STREAM and continues with the connection state from before the chunk, dropping the rest of it. Streams opened by earlier frames in the chunk keep running their Plug calls, but the stream counts,last_stream_id, the rapid-reset timestamps, the HPACK decoder state and the buffer roll back, somax_concurrent_streams,max_requestsand the rapid-reset limiter never see those streams. A client that sends one HEADERS frame more thanmax_concurrent_streamsin each write has the extra refused and the others forgotten: with a limit of 10, five such writes run 50 Plug calls at once.This issue affects bandit: from 1.9.0 before 1.14.0.
Details
1. Function-level rescue.
Bandit.HTTP2.Handler.handle_data/3inlib/bandit/http2/handler.exdeserializes every frame in a TCP chunk inside anEnum.reduce_while/3and wraps the whole function in arescue. Inside thatrescue,stateis the original function argument, not thereduce_whileaccumulator.2. Rollback on StreamError. When
Bandit.HTTP2.Connection.handle_frame/3raisesStreamErrorpartway through the chunk,rescue_stream_error/3sends RST_STREAM and returns{:continue, state}with the connection as it was before the chunk. The rest of the chunk is dropped.3. Lost bookkeeping. Frames already handled keep their side effects: their stream processes are running the Plug. But the stream counts,
last_stream_id,reset_stream_timestamps,recv_hpack_stateandbufferare rolled back, somax_concurrent_streams,max_requestsand the rapid-reset limiter no longer count those streams. The same rollback drops HPACK table updates, which can mix up headers between requests, misaligns frame parsing, and sends a stalelast_stream_idin GOAWAY.Proof of concept
http_2_options: [default_local_settings: [max_concurrent_streams: 10]].Impact
An unauthenticated client can run more concurrent Plug calls on one HTTP/2 connection than the configured
max_concurrent_streamsallows (five times the limit in the reporter's test), tying up the server processes, CPU and memory the limit is meant to cap. Servers that serve HTTP/2 with a finitemax_concurrent_streamsare affected.Workarounds
Disable HTTP/2 with
http_2_options: [enabled: false], so that the vulnerable HTTP/2 handler never runs.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
Quadratic bignum parsing of Content-Length and Host port values in Bandit
CVE-2026-113436 / EEF-CVE-2026-113436 / GHSA-29cr-8477-rg6r
More information
Details
Summary
Inefficient Algorithmic Complexity vulnerability in the header integer parser of mtrudel bandit allows an unauthenticated remote attacker to consume server CPU via a
content-lengthvalue or aHostor:authorityport made of thousands of digits.Bandit.Headers.parse_integer/2inlib/bandit/headers.exbuilds the number one digit at a time with no limit on the digit count, allocating a new bignum at each step, so one value costs time quadratic in its length. It runs on raw request input over HTTP/1 and HTTP/2, before any range check. Over HTTP/2, a 4,000-digit value can be stored once in the HPACK dynamic table and re-sent on each new stream for about one byte: 124 KB of traffic kept the server busy for 27.9 s.This issue affects bandit: from 1.0.0-pre.7 before 1.14.0.
Details
1. Unbounded digit loop.
Bandit.Headers.parse_integer/2inlib/bandit/headers.exbuilds the number withtotal * 10 + digit - ?0and has no limit on the digit count. Each step allocates a new bignum, so parsing one value costs O(n²). On OTP 28, 10,000 digits take about 10 ms, 50,000 about 250 ms and 80,000 about 560 ms, whereString.to_integer/1handles the same inputs in 1 to 3 ms.2. Reached on raw input. It is called from
get_content_length/1andparse_hostlike_header!/1on raw request input, before any range check. An all-digitcontent-lengthis returned as{:ok, huge_int}, and theis_port_numberguard only runs after the whole number is built.3. HPACK amplification. Over HTTP/2, a 4,000-digit value (about 1.1 ms to parse) can be stored once in the HPACK dynamic table and then re-sent on each new stream for about one byte.
Proof of concept
POST /on new streams, each carrying acontent-lengthof 4,0009digits encoded with HPACK indexing, so that every frame after the first refers to the stored value.Impact
An unauthenticated client can make the server spend CPU time out of all proportion to the traffic it sends (27.9 s for 124 KB in the reporter's test). This affects any Bandit server reachable by untrusted clients over HTTP/1 or HTTP/2, with no special configuration.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
WebSocket 1-byte continuation frames bypass
max_fragmented_message_sizein BanditCVE-2026-114213 / EEF-CVE-2026-114213 / GHSA-cpx7-qf6w-jc63
More information
Details
Summary
Allocation 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.
Bandit.WebSocket.Connectionchecksmax_fragmented_message_sizeagainst 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.This issue affects bandit: from 1.11.0 before 1.14.0.
Details
1. Byte-only limit. In
Bandit.WebSocket.Connection(lib/bandit/websocket/connection.ex), the fragment limit is checked againstfragment_size, which only adds up payload bytes (IO.iodata_length(frame.data)).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.3. Kept alive. Ping frames sent between fragments are handled by
handle_control_framewithout touching the fragment state, so they keep the connection alive past the idle timeout.Proof of concept
Impact
An unauthenticated client can make one WebSocket connection hold about 150 times
max_fragmented_message_sizein 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.Workarounds
Lower
websocket_options: [max_fragmented_message_size: ...]to the largest fragmented message the application needs, for example65_536. Memory per connection stays at about 150 times this limit, so a lower limit lowers the ceiling.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
Chunk extensions accept bare LF and CR, enabling request smuggling in Bandit
CVE-2026-114216 / EEF-CVE-2026-114216 / GHSA-w5wc-g2hc-g7m2
More information
Details
Summary
Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') vulnerability in the HTTP/1.1 chunked body reader of mtrudel bandit allows an unauthenticated remote attacker to smuggle a second request past a front-end proxy via a chunk extension that contains a bare LF.
The chunked reader in
lib/bandit/http1/socket.extakes the chunk-size line to be everything up to the first CRLF and discards everything after;without checking it against the RFC 9112chunk-extgrammar, so bare LF, bare CR and other control bytes pass. A proxy that ends the size line at a bare LF reads2;\nxx\r\n40\r\n...as one request whose second chunk holds aGET /admin, while Bandit ends the body early and dispatchesGET /adminas a separate pipelined request. Deployments without such a proxy in front of Bandit are not affected.This issue affects bandit: from 1.12.4 before 1.14.0.
Details
1. Unchecked extension. In
lib/bandit/http1/socket.ex, the chunked body reader takes the chunk-size line to be everything up to the first CRLF. Anything after;is thrown away without being checked against the RFC 9112 §7.1.1chunk-extgrammar, so bare LF, bare CR and other control bytes are accepted. The 16-byte size-line cap does not help, because the payload needs only 5 bytes.2. Bandit's reading. For the body
2;\nxx\r\n40\r\n0\r\n\r\nGET /admin ..., Bandit takes2;\nxxas the size line and40as the 2-byte chunk, and the embedded0\r\n\r\nends the body. Bandit then runsGET /adminas a second pipelined request.3. The proxy's reading. A proxy that ends the size line at the bare LF sees only one POST, with the chunk
xxand a 0x40-byte chunk that holds theGET /adminbytes.Proof of concept
POST /publicwithTransfer-Encoding: chunkedand the body2;\nxx\r\n40\r\n0\r\n\r\n, followed directly byGET /admin HTTP/1.1withContent-Length: 7and the body\r\n0\r\n\r\n.POST /publicwith the body40andGET /admin. A proxy that ends lines at a bare LF would have forwarded the same bytes as the singlePOST /public.Impact
Behind a front-end proxy that treats a bare LF as a line ending and forwards chunked bodies unchanged, an unauthenticated attacker can have Bandit run requests the proxy never saw, getting past the proxy's access controls.
Workarounds
Where the front-end proxy can reach Bandit over HTTP/2, disable HTTP/1 with
http_1_options: [enabled: false], so that the chunked body reader never runs.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:NReferences
This data is provided by OSV.
HTTP/2 WINDOW_UPDATE and SETTINGS frames reset the request body read timeout in Bandit
CVE-2026-115269 / EEF-CVE-2026-115269 / GHSA-p2qv-vx88-385x
More information
Details
Summary
Allocation of Resources Without Limits or Throttling vulnerability in the HTTP/2 request body reader of mtrudel bandit allows an unauthenticated remote attacker to hold stream processes open indefinitely via WINDOW_UPDATE or empty SETTINGS frames sent while a Plug reads the request body.
Bandit.HTTP2.Stream.do_read_data/4inlib/bandit/http2/stream.exwaits for each frame with a freshread_timeout. A stream WINDOW_UPDATE, or the zero-delta window update that every empty SETTINGS frame delivers to all streams, ends the wait without delivering any body data, and the loop starts a new full countdown. A client that sends one of these 9-byte frames before each countdown expires keepsread_bodyblocked, together with the stream process and whatever the application holds while reading, for as long as it likes.This issue affects bandit: from 1.4.0 before 1.14.0.
Details
1. Per-receive timeout.
Bandit.HTTP2.Stream.read_data/2passes a flatread_timeout(default 15,000 ms) todo_read_data/4, which blocks indo_recv/2'sreceive ... after timeout.2. Non-progress frames end the wait. A stream WINDOW_UPDATE, delivered through
Bandit.HTTP2.Connection.handle_frame/3, or an empty SETTINGS frame, which delivers a zero-delta window update to every stream, is matched inside thatreceive.do_recv_send_window_update/2returns a bare%Stream{}, anddo_read_data/4recurses with the identicaltimeout, restarting the countdown.3. Nothing else bounds the read. The transport read timeout fires only when no bytes arrive,
max_bytesis decremented only by DATA frames, and neither WINDOW_UPDATE nor SETTINGS frames are rate limited. The send path indo_send_data/4uses a progress-based deadline; the read path does not.Proof of concept
Plug.Conn.read_body/2.POST /on stream 1 without END_STREAM.read_timeout. Without the WINDOW_UPDATE frames, the server ends the read after about 15 s.Impact
An unauthenticated client can keep a Bandit HTTP/2 stream, and whatever its request handler holds while reading the body, occupied indefinitely for 9 bytes per
read_timeout, and repeat this across many streams and connections. This affects any Bandit server with HTTP/2 enabled whose routes read request bodies, whichPlug.Parsersdoes for POST, PUT and PATCH.Workarounds
Disable HTTP/2 with
http_2_options: [enabled: false], so that the vulnerable read path never runs.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
HTTP/2 request bodies made of 1-byte DATA frames amplify memory use in Bandit
CVE-2026-116078 / EEF-CVE-2026-116078 / GHSA-pxjf-g536-7r93
More information
Details
Summary
Allocation of Resources Without Limits or Throttling vulnerability in the HTTP/2 request body reader of mtrudel bandit allows an unauthenticated remote attacker to exhaust server memory via a request body sent as many 1-byte DATA frames.
do_read_data/5inlib/bandit/http2/stream.exkeeps every DATA frame payload as its own list element until the read returns. The:lengthoption ofread_body/2counts body bytes, not frames, so a body of 1-byte frames costs a list cell and a binary term per byte. Interleaving the frames across up to 500 concurrent streams per connection keeps each stream consuming its frames as they arrive; in the reporter's test, 100 streams held 25 to 40 MiB of stream process memory for 5 MB sent. Only routes whose Plug reads the request body are affected, which includes any route behindPlug.Parsers.This issue affects bandit: from 0.3.1 before 1.14.1.
Details
1. Per-frame accumulation.
Bandit.HTTP2.Stream.read_data/2callsdo_read_data/5inlib/bandit/http2/stream.ex, which prepends each{:data, data, stream}payload to a list ([data | acc]) and reverses it when the read returns. Each 1-byte payload arrives as a separate message from the connection process, so the stream heap holds a cons cell and a heap binary per frame.2. Byte-only limit.
:length(default 8,000,000) is decremented bybyte_size(data)and bounds body bytes, not the number of frames. A read ends at:lengthor at itsread_timeoutdeadline, and 1-byte frames add no measurable deadline credit, so a stream holds whatever arrives within the deadline at the per-frame overhead ratio.Plug.Parsersanswers 413 on:more, and the client continues on a new stream.3. Interleaving defeats connection buffering. The connection buffers DATA for a stream only once that stream has 16 messages outstanding. A stream that keeps up never reaches this, and interleaving one frame per stream per round across many streams keeps every stream under it regardless of TCP segment size.
4. Measurements on 1.14.0. 100 streams of 5,000 interleaved 1-byte frames (5,000,000 bytes on the wire, 488 KiB of body) held 25 to 40 MiB in stream processes, with empty mailboxes. One stream of 60,000 frames sent one per write held 2 to 4 MiB for 58 KiB of body.
Proof of concept
Plug.Conn.read_body(conn)with default options.POST /without END_STREAM on 100 streams (IDs 1, 3, 5, ...).Impact
An unauthenticated client can make a Bandit HTTP/2 server hold about 5 to 8 times the bytes it sends in stream process memory, across up to 500 streams per connection and many connections, for as long as each body read runs. This affects any Bandit server with HTTP/2 enabled whose routes read request bodies, which
Plug.Parsersdoes for POST, PUT and PATCH.Workarounds
From 0.7.0, disable HTTP/2 with
http_2_options: [enabled: false], so that the vulnerable body reader never runs.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by OSV.
Release Notes
mtrudel/bandit (bandit)
v1.14.1Compare Source
Changes
the connection stayed open and could serve a later request (#729, thanks @neilberkman!)
hostheader does not match:authority, or that has more thanone
hostheader, with a stream PROTOCOL_ERROR (RFC 9113 §8.3.1) (#725, thanks @neilberkman!)connection,keep-alive,proxy-connection,transfer-encodingandupgrade) from HTTP/2 responses, as RFC 9113 §8.2.2 requires. Before,clients such as curl and Firefox reset the stream (#728, thanks @mpettibone!)
Fixes
longer uses many times its size in memory (GHSA-pxjf-g536-7r93, thanks @neilberkman!)
Accept-Encodingq-values with the RFC 9110 §12.4.2 grammar. Before, a q-value with a verylong integer part caused a 500 on every request (#733, thanks @mpettibone!)
Hostheaderwith a trailing space got a 400 (#731, thanks @mpettibone!)
[::1]80) (RFC 3986§3.2) (#730, thanks @neilberkman!)
decoder state (RFC 9113 §5.4.2) (#726, thanks @neilberkman!)
v1.14.0Compare Source
Changes
max_concurrent_streamsof 500 and a defaultmax_header_list_sizeof 262144 bytes in the initial SETTINGS frame. Before, both were unlimited. The entries of a
SETTINGS frame are now sorted
window to 1 MiB only after the stream reads data. Before, the server granted 2^31-1 bytes on the
first DATA frame
read_bodycan return more than:lengthbytes, up to the stream receive windowconnection with ENHANCE_YOUR_CALM when a client sends more than 100 non-ACK SETTINGS frames in
10 seconds
END_STREAM
the last stream that the server started in the GOAWAY frame
:erlang.decode_packet/3readsdifferently from RFC 3986. As a result, a target with an empty path followed by a query (for
example
http://host:80?a=b) now gets 400. Before, its query was silently discardedHTTP/1.1orHTTP/1.0;of a chunk extension, as RFC 9112 §7.1.1 permitsconn.port == 0, the same as for aHostheader. Before, it was reported as the scheme's default port
even if the peer keeps sending frames or sends nothing. The close timeout is the WebSock
timeoutoption, else theread_timeout, else 60 seconds when the timeout is:infinityFixes
that a client cannot queue DATA without bound in a stream (CVE-2026-108525, thanks
@PJUllrich!, GHSA-pxfw-2r8w-g3jv, thanks @manus-pi!)
(CVE-2026-115269, thanks @manus-pi!)
size, and keep pending sends in a queue (CVE-2026-108529, thanks @PJUllrich!)
GHSA-ggpf-wvx5-f4h8, thanks @neilberkman!)
(CVE-2026-110499, thanks @PJUllrich!)
middle of a read, so that per-connection limits still apply (CVE-2026-111103, thanks
@PJUllrich!, GHSA-q48c-59mm-jx3c, thanks @neilberkman!)
no longer uses many times its size in memory (CVE-2026-111101, thanks @PJUllrich!)
end of each trailer line, to prevent request smuggling (CVE-2026-114216, thanks @PJUllrich!)
content-lengthand port values, to prevent quadratic parsing time(CVE-2026-113436, thanks @PJUllrich!)
:erlang.decode_packet/3wrapped a large port (host:4294967376was read as port 80), andignored a port that it could not parse
:erlang.decode_packet/3wraps or reads loosely (for exampleHTTP/4294967297.1,HTTP/01.01orHTTP/1.1x)1 byte fragments cannot hold far more memory than
max_fragmented_message_size(CVE-2026-114213, thanks @PJUllrich!)
(CVE-2026-110314, thanks @PJUllrich!)
1 byte packets cannot hold far more memory than
max_frame_sizev1.13.1Compare Source
Reverts
code paths in Phoenix depend on stale conns (notably,
Plug.Parserserrors rendered byPhoenix.Endpoint.RenderErrors). See elixir-plug/plug#1331v1.13.0Compare Source
Enhancements
compress_chunkedoption to compress chunked responses with gzip and zstd (#707, thanks @iStefo!)inet6option behaviour on dual-stack platforms (#709, #700, thanks @adelton!)Changes
(#718)
conn.portas an integer forCONNECTrequests, asPlug.ConnrequiresFixes
same grammar as the
Hostheader (GHSA-v53v-9hvg-37jf, thanks @euriconicacio!)can no longer keep a stream pinned indefinitely (GHSA-69m6-wcv4-rwcf, thanks @tomciopp!)
4xx/5xx error responses with
Content-Length: 0(#705, thanks @jeregrine!)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
Pull request closed