CVE-2026-39806: CWE-835 Loop with Unreachable Exit Condition ('Infinite Loop') in mtrudel bandit
Loop with Unreachable Exit Condition ('Infinite Loop') vulnerability in mtrudel bandit allows unauthenticated remote denial of service via worker process exhaustion. 'Elixir.Bandit.HTTP1.Socket':do_read_chunked_data!/5 in lib/bandit/http1/socket.ex terminates only when the last-chunk line 0\r\n is followed immediately by the empty trailer line \r\n. RFC 9112 §7.1.2 permits zero or more trailer fields between them. When trailers are present, none of the match clauses fit: the catch-all arm computes a negative to_read, calls read_available!/2, receives <<>> on timeout, and tail-recurses with unchanged state. The worker process is pinned for the lifetime of the TCP connection. A handful of concurrent connections sending RFC-conformant chunked requests with trailer fields is sufficient to exhaust the Bandit worker pool and render the server unresponsive to all further traffic. No authentication, special headers, or large payload is required. Proxies such as NGINX and HAProxy legitimately forward trailer-bearing requests, so servers behind such proxies may be affected without any malicious client involvement. This issue affects bandit: from 1.6.1 before 1.11.1.
AI Analysis
Technical Summary
The vulnerability arises in the Elixir.Bandit.HTTP1.Socket module's do_read_chunked_data!/5 function, which expects the last chunk line (0\r\n) to be immediately followed by an empty trailer line (\r\n). However, RFC 9112 permits zero or more trailer fields between these lines. When trailers are present, the function's pattern matching fails, causing a catch-all clause to compute a negative to_read value and recursively call read_available!/2 without progressing. This results in an infinite loop that pins the worker process for the duration of the TCP connection. Multiple concurrent connections with trailer-bearing chunked requests can exhaust the Bandit worker pool, making the server unresponsive. This affects bandit versions from 1.6.1 up to but not including 1.11.1.
Potential Impact
An unauthenticated remote attacker or even legitimate clients/proxies sending RFC-compliant chunked requests with trailer fields can cause worker process exhaustion, resulting in a denial of service condition. The server becomes unresponsive to further traffic due to all worker processes being pinned in infinite loops. No special privileges or large payloads are required to trigger the issue.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or temporary workaround is indicated in the provided data. Until a patch is available, consider limiting or filtering requests with trailer fields at upstream proxies if feasible to reduce exposure.
CVE-2026-39806: CWE-835 Loop with Unreachable Exit Condition ('Infinite Loop') in mtrudel bandit
Description
Loop with Unreachable Exit Condition ('Infinite Loop') vulnerability in mtrudel bandit allows unauthenticated remote denial of service via worker process exhaustion. 'Elixir.Bandit.HTTP1.Socket':do_read_chunked_data!/5 in lib/bandit/http1/socket.ex terminates only when the last-chunk line 0\r\n is followed immediately by the empty trailer line \r\n. RFC 9112 §7.1.2 permits zero or more trailer fields between them. When trailers are present, none of the match clauses fit: the catch-all arm computes a negative to_read, calls read_available!/2, receives <<>> on timeout, and tail-recurses with unchanged state. The worker process is pinned for the lifetime of the TCP connection. A handful of concurrent connections sending RFC-conformant chunked requests with trailer fields is sufficient to exhaust the Bandit worker pool and render the server unresponsive to all further traffic. No authentication, special headers, or large payload is required. Proxies such as NGINX and HAProxy legitimately forward trailer-bearing requests, so servers behind such proxies may be affected without any malicious client involvement. This issue affects bandit: from 1.6.1 before 1.11.1.
CVSS v4.0
Score 8.7high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises in the Elixir.Bandit.HTTP1.Socket module's do_read_chunked_data!/5 function, which expects the last chunk line (0\r\n) to be immediately followed by an empty trailer line (\r\n). However, RFC 9112 permits zero or more trailer fields between these lines. When trailers are present, the function's pattern matching fails, causing a catch-all clause to compute a negative to_read value and recursively call read_available!/2 without progressing. This results in an infinite loop that pins the worker process for the duration of the TCP connection. Multiple concurrent connections with trailer-bearing chunked requests can exhaust the Bandit worker pool, making the server unresponsive. This affects bandit versions from 1.6.1 up to but not including 1.11.1.
Potential Impact
An unauthenticated remote attacker or even legitimate clients/proxies sending RFC-compliant chunked requests with trailer fields can cause worker process exhaustion, resulting in a denial of service condition. The server becomes unresponsive to further traffic due to all worker processes being pinned in infinite loops. No special privileges or large payloads are required to trigger the issue.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or temporary workaround is indicated in the provided data. Until a patch is available, consider limiting or filtering requests with trailer fields at upstream proxies if feasible to reduce exposure.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- EEF
- Date Reserved
- 2026-04-07T12:28:54.916Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a0488f0cbff5d8610d62f9e
Added to database: 05/13/2026, 14:21:36 UTC
Last enriched: 05/27/2026, 20:06:05 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 93
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.