🇰🇷 한글 설명
Bandit HTTP 서버의 청크 인코딩 처리 함수에서 RFC 9112 표준의 trailer 필드를 올바르게 처리하지 못해 무한 루프 발생. 워커 프로세스가 TCP 연결 종료까지 고정되어 리소스 고갈로 인한 서비스 거부 가능.
💡 쉬운 설명
웹 서버가 특정 형식의 HTTP 요청을 받으면 프로세스가 무한 대기 상태에 빠짐. 공격자가 이러한 요청을 몇 개만 보내도 전체 서버가 응답 불가 상태로 변함.
🇺🇸 원문 (English)
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.
📍 영향받는 시스템
Elixir Bandit 1.6.1 ~ 1.11.0
⚔️ 공격 벡터
Trailer 필드를 포함한 RFC 준수 chunked 인코딩 HTTP 요청 전송
🛡️ 대응 방법
Bandit을 1.11.1 이상으로 즉시 업그레이드
🔧 검증 코드
출력된 버전이 1.11.1 이상이면 안전, 1.11.0 이하면 취약함
grep -E '"bandit".*:' mix.lock 2>/dev/null | head -1