CRLF injection in WebSocket upgrade request in hackney
A public exploit exists; no exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 1%. Fixed in 4.0.1 and 52310ca807e7b48441ba0e9129171f535313fdd1.
Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in benoitc hackney allows HTTP Request/Response Splitting. The WebSocket upgrade code in src/hackney_ws.erl copies the host, path, headers (ExtraHeaders), and protocols options from the caller-supplied opts map into the internal #ws_data{} record in init/1 and then splices them verbatim into the raw HTTP/1.1 upgrade request by binary concatenation in do_handshake/1. No CRLF or NUL stripping is performed at any of these four injection sites. An attacker who controls any of these options — for example by forwarding URL components or header values from untrusted input into hackney_ws:start_link/1 — can inject arbitrary HTTP headers into the outbound WebSocket upgrade request, leading to header injection, credential spoofing toward the upstream server, log and cache poisoning, or request smuggling via intermediary proxies. This issue affects hackney: from 2.0.0-beta.1 before 4.0.1.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| benoitc | >=2.0.0-beta.1 <4.0.1, >=690cecaf236fba49526da404a5bc889a24367a3e <52310ca807e7b48441ba0e9129171f535313fdd1 | 4.0.1, 52310ca807e7b48441ba0e9129171f535313fdd1 | |
| benoitc | hackney | >=2.0.0 <4.0.1 | 4.0.1 |
Exploit evidence
1 public sources
Timeline
Every event on this vulnerability
Embed
A live severity badge for an advisory, README or ticket