製品・ソフトウェアに関する情報
MtrudelのBanditにおける無限ループに関する脆弱性
Title MtrudelのBanditにおける無限ループに関する脆弱性
Summary

mtrudel banditのループに到達不可能な終了条件(「無限ループ」)の脆弱性により、認証されていないリモートからのワーカープロセス枯渇によるサービス拒否攻撃が可能です。lib/bandit/http1/socket.ex内の 'Elixir.Bandit.HTTP1.Socket':do_read_chunked_data!/5 は、最後のチャンクライン0\r\nが空のトレーラー行\r\nに直ちに続く場合にのみ終了します。RFC 9112 §7.1.2では、それらの間にゼロまたは複数のトレーラーフィールドが許可されています。トレーラーが存在する場合、どのマッチ節も該当せず、catch-allの腕が負のto_readを計算し、read_available!/2を呼び出して、タイムアウト時にを受信し、状態を変更せずに尾再帰を行います。結果としてワーカープロセスはTCP接続の寿命期間に固定されます。RFC準拠のトレーラーフィールド付きチャンクリクエストを送信する数個の同時接続でBanditのワーカープールが枯渇し、サーバーはそれ以降のトラフィックに応答しなくなります。認証、特殊ヘッダー、大きなペイロードは不要です。NGINXやHAProxyのようなプロキシは正当にトレーラー付きリクエストを転送するため、このようなプロキシ背後にあるサーバーは悪意あるクライアントの関与なしに影響を受ける可能性があります。この問題はbanditのバージョン1.6.1から1.11.1未満に影響を与えます。

Possible impacts 当該ソフトウェアが扱う情報について、外部への漏えいは発生しません。 また、当該ソフトウェアが扱う情報について、書き換えは発生しません。 さらに、当該ソフトウェアが完全に停止する可能性があります。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 
Solution

正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。

Publication Date May 13, 2026, midnight
Registration Date May 25, 2026, 10:25 a.m.
Last Update May 25, 2026, 10:25 a.m.
CVSS3.0 : 重要
Score 7.5
Vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Affected System
Mtrudel
Bandit 1.6.1 以上 1.11.1 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
その他
Change Log
No Changed Details Date of change
1 [2026年05月25日]
  掲載
May 25, 2026, 10:25 a.m.

NVD Vulnerability Information
CVE-2026-39806
Summary

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.

Publication Date May 13, 2026, 11:17 p.m.
Registration Date May 15, 2026, 4:20 a.m.
Last Update May 14, 2026, 1:16 a.m.
Related information, measures and tools
Common Vulnerabilities List