Bandit HTTP/1 Chunked Request Trailer Denial of Service
Bandit versions 1.6.0 through 1.11.0 are vulnerable to an unauthenticated denial-of-service (CVE-2026-39806) via a chunked request with trailers, where sending a request with `Transfer-Encoding: chunked` and a trailer field causes the connection's worker process to spin forever in an infinite recursion, exhausting the listener pool and rendering the server unresponsive.
A worker-pinning denial-of-service vulnerability exists in Bandit’s HTTP/1 chunked transfer decoder (CVE-2026-39806). The vulnerability affects Bandit versions 1.6.0 through 1.11.0. Any unauthenticated client sending a Transfer-Encoding: chunked request with a body ending with a trailer field causes the connection’s worker process to become stuck in an infinite recursion. This occurs because the do_read_chunked_data!/5 function in lib/bandit/http1/socket.ex does not properly handle trailer fields in chunked requests, leading to repeated calls to read_available!/2 without progress. A small number of concurrent connections can exhaust the listener pool, rendering the server unresponsive to further traffic. The vulnerability was introduced with commit e73e379ab59840e8561b5730878f16e29ab06217 on December 6, 2024.
Attack Chain
- An attacker sends an HTTP POST request to the vulnerable Bandit server.
- The request includes the
Transfer-Encoding: chunkedheader to indicate a chunked transfer encoding. - The request body consists of at least one data chunk followed by the last-chunk marker
0\r\n. - The request body then includes a trailer field, such as
X-Trailer: value\r\n, after the last chunk marker. - The request is terminated with
\r\nto signal the end of the message. - The
do_read_chunked_data!/5function inlib/bandit/http1/socket.exattempts to parse the chunked data. - Due to the presence of the trailer field, the function fails to match the terminator clause and enters the
_ ->arm, leading to a negativeto_readvalue and a call toread_available!/2. - The function tail-recurses with the same state, causing an infinite loop and pinning the worker process, ultimately leading to denial of service.
Impact
Successful exploitation results in an unauthenticated denial-of-service condition. A small number of attacker-controlled connections can exhaust the available worker pool, rendering the server unreachable for legitimate users. This impacts any Bandit-fronted HTTP/1 service that accepts chunked request bodies, including Phoenix and Plug applications. Servers behind proxies forwarding trailer-bearing requests are also vulnerable.
Recommendation
- Apply the vendor-supplied patch to upgrade to Bandit version 1.11.1 or later, which resolves the vulnerability (reference: https://github.com/advisories/GHSA-rf5q-vwxw-gmrf).
- Deploy the Sigma rule
Detect Bandit Chunked Trailer DoS Attemptto identify requests exploiting this vulnerability in your environment (reference: Sigma rule below). - Monitor web server logs for HTTP POST requests with
Transfer-Encoding: chunkedand trailer fields (reference:webserverlog source).
Detection coverage 2
Detect Bandit Chunked Trailer DoS Attempt
highDetects CVE-2026-39806 exploitation — HTTP POST requests with chunked transfer encoding and trailer fields sent to a Bandit server, indicating a potential denial-of-service attempt.
Detect Suspicious HTTP Request with Chunked Encoding and Trailer
mediumDetects suspicious HTTP requests using chunked transfer encoding and trailer fields, potentially indicative of the Bandit DoS vulnerability (CVE-2026-39806).
Detection queries are available on the platform. Get full rules →