MtrudelのBanditにおける無限ループに関する脆弱性
タイトル MtrudelのBanditにおける無限ループに関する脆弱性
概要

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未満に影響を与えます。

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

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

公表日 2026年5月13日0:00
登録日 2026年5月25日10:25
最終更新日 2026年5月25日10:25
CVSS3.0 : 重要
スコア 7.5
ベクター CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
影響を受けるシステム
Mtrudel
Bandit 1.6.1 以上 1.11.1 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
その他
変更履歴
No 変更内容 変更日
1 [2026年05月25日]
  掲載
2026年5月25日10:25

NVD脆弱性情報
CVE-2026-39806
概要

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.

公表日 2026年5月13日23:17
登録日 2026年5月15日4:20
最終更新日 2026年5月14日1:16
関連情報、対策とツール
共通脆弱性一覧