Executive brief
Bandit is an HTTP server library used to build web applications in Elixir. An attacker can inject carriage return, line feed, or null characters into HTTP/2 request headers without authentication. While Bandit itself doesn't directly exploit these injected characters, downstream applications that log or forward these headers verbatim could be vulnerable to log injection or request smuggling attacks.
Technical details
This is a CRLF injection vulnerability in the HTTP/2 header parsing logic of Bandit. The root cause is that Bandit.HTTP2.Stream.read_headers/1 validates pseudo-header placement, uniqueness, casing, and certain header values, but does not validate that field values are free of carriage return (\r), line feed (\n), or null (\0) characters. Because HPACK (HTTP/2 header compression) can carry arbitrary octets, malicious characters pass through unchanged into conn.req_headers. The HTTP/1 code path already rejects these characters, but HTTP/2 did not. The attack is unauthenticated and network-reachable. An additional related issue is that duplicate :authority pseudo-headers are accepted instead of rejected. The impact depends on how the application consumes header values; direct log injection or upstream request smuggling are possible if headers are concatenated unsanitized.
Affected products
- mtrudel bandit 1.4.0 before 1.12.5
Timeline
- 2026-08-20: disclosed