CVE-2026-47072

CRLF injection in WebSocket upgrade request in hackney

Published May 25, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability originates from the WebSocket upgrade logic in the hackney library, where the host, path, headers, and protocols options supplied via the opts map are concatenated directly into the raw HTTP/1.1 upgrade request without any sanitization, and no CRLF or NUL stripping is performed. This design flaw enables an attacker who can inject CRLF or NUL bytes into any of these fields to perform CRLF injection, allowing arbitrary HTTP header injection. Such header injection can be used for credential spoofing against upstream servers, log or cache poisoning, or request smuggling through intermediary proxies. The weakness is classified as CWE‑93 (Improper Neutralization of CRLF Sequences).

Affected Systems

The affected product is the Erlang/OTP HTTP client library hackney, in all releases from version 2.0.0 up to, but not including, 4.0.1. The fix is available in version 4.0.1 and later. No further sub‑product distinctions are indicated.

Risk and Exploitability

The CVSS base score of 6.9 indicates a moderate impact. The EPSS score of < 1% indicates a very low but non‑zero probability of exploitation, and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires that an attacker can influence the opts map passed to hackney_ws:start_link/1, which typically means control over part of the WebSocket client request. No public exploits have been documented yet, but the possibility of header injection, credential spoofing, and request smuggling presents a credible threat in environments where untrusted input may reach the library.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade hackney to version 4.0.1 or later, which eliminates the unsanitized concatenation.
  • If an upgrade is not feasible, sanitize all values supplied for host, path, headers, or protocols by stripping CRLF or NUL characters before passing them to hackney_ws:start_link/1.
  • Refactor any code that injects user-supplied data into the opts map for WebSocket connections to use trusted or hardcoded values instead.

Generated by OpenCVE AI on November 22, 2026 at 23:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-f9vr-g2g2-x9fg Hackney has CRLF / header injection in WebSocket upgrade request
History
Type Values Removed Values Added
Description 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 before 4.0.1. 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.
References
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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 before 4.0.1.
Title CRLF injection in WebSocket upgrade request in hackney
First Time appeared Benoitc
Benoitc hackney
Weaknesses CWE-93
CPEs cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*
Vendors & Products Benoitc
Benoitc hackney
References
Metrics cvssV4_0

{'score': 6.9, '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'}

Weaknesses
  • CWE-93

    Improper Neutralization of CRLF Sequences ('CRLF Injection')

Sources

Status
PUBLISHED
Assigner
EEF
Published
Updated
Nov 20, 2026, 8:07 AM
Reserved
May 18, 2026, 5:28 PM
Status
Modified
Published
May 25, 2026, 3:16 PM
Modified
Nov 20, 2026, 9:20 AM