{"id":"CVE-2026-47072","aliases":["CVE-2026-47072","GHSA-f9vr-g2g2-x9fg","EEF-CVE-2026-47072"],"related":[],"kind":"vulnerability","state":"published","title":"CRLF injection in WebSocket upgrade request in hackney","summary":"Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in benoitc hackney allows HTTP Request/Response Splitting.\n\nThe 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.\n\nThis issue affects hackney: from 2.0.0-beta.1 before 4.0.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in benoitc hackney allows HTTP Request/Response Splitting.\n\nThe 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.\n\nThis issue affects hackney: from 2.0.0-beta.1 before 4.0.1.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nCRLF injection in hackney's WebSocket upgrade request builder (`src/hackney_ws.erl`). `init/1` copies the `host`, `path`, `headers`, and `protocols` options from the caller-supplied opts map verbatim into `#ws_data{}`, and `do_handshake/1` splices them directly into the raw HTTP/1.1 upgrade request by binary concatenation with no `\\r\\n` or `\\0` stripping. A caller that passes any of these fields from untrusted input can inject arbitrary header lines into the outbound upgrade request.\n\n### Details\n\n`do_handshake/1` builds the upgrade request at several concatenation sites:\n\n- **Host header** (lines 583–590): the host binary is written straight into `Host: <host>:<port>\\r\\n`.\n- **Sec-WebSocket-Protocol** (lines 601–602): protocol tokens are joined with `, ` and appended as a header line.\n- **Extra headers** (line 606): caller-supplied `{Name, Value}` tuples are concatenated as `Name: Value\\r\\n` with no sanitization of either component.\n- **Request path** (line 611): the path is interpolated into the `GET <path> HTTP/1.1\\r\\n` request line.\n\nNone of these sites reject `\\r`, `\\n`, or `\\0`. A header value like `<<\"benign\\r\\nAuthorization: Bearer token\">>` produces two distinct header lines on the wire. A path with an embedded `\\r\\n` rewrites the request line itself.\n\n### PoC\n\n1. Call `:hackney_ws.start_link/1` with `headers: [{\"X-User\", \"v\\r\\nAuthorization: Bearer attacker\"}]`.\n2. Connect to a raw TCP listener and capture the bytes hackney writes.\n3. The request contains a standalone `Authorization: Bearer attacker` line that the upstream WebSocket server parses as a legitimate header.\n\n### Impact\n\nHeader injection / request smuggling in outbound WebSocket upgrades. Affects hackney 2.0.0 through 4.0.0 wherever `host`, `path`, `headers`, or `protocols` options are populated from network or user input. Consequences include forging authentication headers toward the upstream server, log and cache poisoning, and request smuggling through intermediary proxies. CVSS v4.0: **6.9 (MEDIUM)**.\n\n## Resources\n\n* Introduction commit: https://github.com/benoitc/hackney/commit/690cecaf236fba49526da404a5bc889a24367a3e\n* Patch commit: https://github.com/benoitc/hackney/commit/52310ca807e7b48441ba0e9129171f535313fdd1","format":"markdown","source":"ghsa"},{"lang":"en","text":"## Summary\n\nImproper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in benoitc hackney allows HTTP Request/Response Splitting.\n\nThe 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.\n\nThis issue affects hackney: from 2.0.0-beta.1 before 4.0.1.","format":"markdown","source":"eef"},{"lang":"es","text":"La vulnerabilidad de Neutralización Inadecuada de Secuencias CRLF ('Inyección CRLF') en benoitc hackney permite la División de Solicitudes/Respuestas HTTP. El código de actualización de WebSocket en src/hackney_ws.erl copia las opciones de host, ruta, encabezados (ExtraHeaders) y protocolos del mapa de opciones (opts map) proporcionado por el llamador en el registro interno #ws_data{} en init/1 y luego los empalma textualmente en la solicitud de actualización HTTP/1.1 sin procesar mediante concatenación binaria en do_handshake/1. No se realiza ninguna eliminación de CRLF o NUL en ninguno de estos cuatro sitios de inyección. Un atacante que controla cualquiera de estas opciones - por ejemplo, reenviando componentes de URL o valores de encabezado de entrada no confiable a hackney_ws:start_link/1 - puede inyectar encabezados HTTP arbitrarios en la solicitud de actualización de WebSocket saliente, lo que lleva a la inyección de encabezados, suplantación de credenciales hacia el servidor ascendente, envenenamiento de registros y caché, o contrabando de solicitudes a través de proxies intermediarios.\n\nEste problema afecta a hackney: desde 2.0.0 antes de 4.0.1.","source":"nvd"}],"published":"2026-05-25T14:00:47.852Z","modified":"2026-11-26T17:23:03.014Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:H/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:H/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:H/SA:N","rating":"MEDIUM"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:H/SA:N"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-93"],"affected":[{"ranges":[{"type":"semver","introduced":"2.0.0-beta.1","fixed":"4.0.1","status":"affected"}],"vendor":"benoitc","product":"hackney","package":"hackney","cpe":"cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*","repo":"https://github.com/benoitc/hackney","source":"cvelist"},{"ranges":[{"type":"git","introduced":"690cecaf236fba49526da404a5bc889a24367a3e","fixed":"52310ca807e7b48441ba0e9129171f535313fdd1","status":"affected"}],"vendor":"benoitc","product":"hackney","package":"benoitc/hackney","cpe":"cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*","repo":"https://github.com/benoitc/hackney","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"4.0.1"}],"ecosystem":"Hex","package":"hackney","purl":"pkg:hex/hackney","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.0.0-beta.1","status":"affected","fixed":"4.0.1"}],"ecosystem":"Hex","package":"hackney","purl":"pkg:hex/hackney","source":"eef"},{"ranges":[{"type":"git","introduced":"690cecaf236fba49526da404a5bc889a24367a3e","status":"affected","fixed":"52310ca807e7b48441ba0e9129171f535313fdd1"}],"repo":"https://github.com/benoitc/hackney","source":"eef"},{"ranges":[{"status":"affected","introduced":"2.0.0","fixed":"4.0.1"}],"vendor":"benoitc","product":"hackney","cpe":"cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/benoitc/hackney/security/advisories/GHSA-f9vr-g2g2-x9fg","tags":["advisory","exploit","patch","related","vendor-advisory","web"],"sources":["cvelist","ghsa","eef","nvd"]},{"url":"https://cna.erlef.org/cves/CVE-2026-47072.html","tags":["patch","related","third-party-advisory","web"],"sources":["cvelist","ghsa","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-47072","tags":["patch","related","third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/benoitc/hackney/commit/690cecaf236fba49526da404a5bc889a24367a3e","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/benoitc/hackney/commit/52310ca807e7b48441ba0e9129171f535313fdd1","tags":["fix","patch","web"],"sources":["cvelist","ghsa","eef","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47072","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/benoitc/hackney","tags":["package"],"sources":["ghsa"]},{"url":"https://hex.pm/packages/hackney","tags":["package"],"sources":["eef"]}],"credits":["Peter Ullrich","Jonatan Männchen / EEF","Benoit Chesneau"],"assigner":"EEF","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-05-26T15:46:12.092Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47072","url":"https://www.cve.org/CVERecord?id=CVE-2026-47072","licence":"CVE Terms of Use","modified":"2026-11-20T08:07:07.016Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f9vr-g2g2-x9fg","url":"https://github.com/advisories/GHSA-f9vr-g2g2-x9fg","licence":"CC-BY-4.0","modified":"2026-06-26T22:15:08.704Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-47072","url":"https://osv.dev/vulnerability/EEF-CVE-2026-47072","licence":"CC-BY-4.0","modified":"2026-11-26T17:23:03.014Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47072","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47072","licence":"Public domain","modified":"2026-11-20T09:20:10.007Z"}],"updatedAt":"2026-11-26T17:37:06.789Z","epss":{"score":0.00517,"percentile":0.373,"date":"2026-11-30T12:00:22.000Z"}}