8.7high
Unbounded memory consumption in WebSocket client in hackney
- Severity
- 8.7high CVSS:4.0 by EEF
- Exploit likelihood
- 0.85% (higher than 59% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- EEF
- Also known as
- GHSA-q8jg-fgj4-fphfEEF-CVE-2026-47073
Description
Allocation of Resources Without Limits or Throttling vulnerability in benoitc hackney allows Flooding. The WebSocket client in src/hackney_ws.erl imposes no upper bound on memory consumption in three code paths. First, read_handshake_response/3 accumulates received bytes into a growing buffer with no size cap; the per-receive timeout resets on every chunk, so a server that streams bytes without ever sending \r\n\r\n causes the buffer to grow until memory is exhausted. Second, parse_payload/9 and parse_active_payload/8 do not validate the declared frame payload length against any limit; because RFC 6455 allows payload lengths up to 2^63-1 bytes, a server that announces a very large frame and dribbles bytes causes the accumulation buffer to grow until OOM. Third, the frag_buffer field in #ws_data{} accumulates continuation frames indefinitely; a server that sends an endless stream of non-final (nofin) fragmented frames without ever sending a final (fin) frame grows frag_buffer without bound. In all three cases the attacker only needs to control the WebSocket server the hackney client connects to, with no authentication or special client configuration required. This issue affects hackney: from 2.0.0-beta.1 before 4.0.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| hackney | from 2.0.0-beta.1 before 4.0.1 | CVE List |
| benoitc/hackney | from 690cecaf236fba49526da404a5bc889a24367a3e before ce0109e2970ace6e20ff29bae9d05c3ac22ec6dc | CVE List |
| hackney (Hex) | from 2.0.0 before 4.0.1, from 2.0.0-beta.1 before 4.0.1 | GitHub Advisory Database, Erlang Ecosystem Foundation |
| https://github.com/benoitc/hackney | from 690cecaf236fba49526da404a5bc889a24367a3e before ce0109e2970ace6e20ff29bae9d05c3ac22ec6dc | Erlang Ecosystem Foundation |
| benoitc hackney | from 2.0.0 before 4.0.1 | NVD |
All scores
| EEF | 8.7high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| Erlang Ecosystem Foundation | Not scored CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
Allocation of Resources Without Limits or Throttling vulnerability in benoitc hackney allows Flooding. The WebSocket client in src/hackney_ws.erl imposes no upper bound on memory consumption in three code paths. First, read_handshake_response/3 accumulates received bytes into a growing buffer with no size cap; the per-receive timeout resets on every chunk, so a server that streams bytes without ever sending \r\n\r\n causes the buffer to grow until memory is exhausted. Second, parse_payload/9 and parse_active_payload/8 do not validate the declared frame payload length against any limit; because RFC 6455 allows payload lengths up to 2^63-1 bytes, a server that announces a very large frame and dribbles bytes causes the accumulation buffer to grow until OOM. Third, the frag_buffer field in #ws_data{} accumulates continuation frames indefinitely; a server that sends an endless stream of non-final (nofin) fragmented frames without ever sending a final (fin) frame grows frag_buffer without bound. In all three cases the attacker only needs to control the WebSocket server the hackney client connects to, with no authentication or special client configuration required. This issue affects hackney: from 2.0.0-beta.1 before 4.0.1.
GitHub Advisory Database
Summary
The WebSocket client in src/hackney_ws.erl imposes no upper bound on memory consumption across three distinct code paths. In each case, an attacker-controlled WebSocket server can exhaust the connecting process's memory without any authentication or special client configuration.
Details
1. Handshake response buffer (read_handshake_response/3)
The function accumulates received bytes into a growing buffer waiting for \r\n\r\n. The per-receive timeout resets on every chunk, so a server that trickles bytes indefinitely without completing the HTTP upgrade response grows the buffer until OOM. No total-size cap exists.
2. Frame payload accumulation (parse_payload/9, parse_active_payload/8)
parse_payload/9 (lines 816–817 and 825–826) appends each received chunk into a Buffer binary via <<Buffer/binary, MoreData/binary>> whenever the frame parser returns {more, ...}. parse_active_payload/8 does the same in active mode by appending each incoming tcp/ssl message to #ws_data.buffer. RFC 6455 permits payload lengths up to 2⁶³-1 bytes, and neither path validates the declared Len against any limit. The recv_timeout applies per chunk, not to the whole frame, so a slow trickle never triggers it.
3. Fragmentation buffer (frag_buffer)
The frag_buffer field of #ws_data{} accumulates continuation frames. A server that sends an unbounded stream of non-final (nofin) fragments without ever sending a final (fin) frame grows frag_buffer without bound.
PoC
- Stand up a WebSocket server and connect to it with hackney's WebSocket client.
- Trigger any of the three paths: (a) never send
\r\n\r\nduring the handshake; (b) announce a very large frame payload and dribble bytes slowly; (c) send an endless stream ofnofincontinuation frames. - Observe the hackney process's memory growing until the BEAM OOM-kills it or the node crashes.
Impact
Denial of service via unbounded memory consumption. Affects hackney 2.0.0 through 4.0.0 for any application using the WebSocket client against an attacker-controlled server. No authentication or special configuration is required on the client side. CVSS v4.0: 8.7 (HIGH).
Resources
Erlang Ecosystem Foundation
Summary
Allocation of Resources Without Limits or Throttling vulnerability in benoitc hackney allows Flooding.
The WebSocket client in src/hackney_ws.erl imposes no upper bound on memory consumption in three code paths. First, read_handshake_response/3 accumulates received bytes into a growing buffer with no size cap; the per-receive timeout resets on every chunk, so a server that streams bytes without ever sending \r\n\r\n causes the buffer to grow until memory is exhausted. Second, parse_payload/9 and parse_active_payload/8 do not validate the declared frame payload length against any limit; because RFC 6455 allows payload lengths up to 2^63-1 bytes, a server that announces a very large frame and dribbles bytes causes the accumulation buffer to grow until OOM. Third, the frag_buffer field in #ws_data{} accumulates continuation frames indefinitely; a server that sends an endless stream of non-final (nofin) fragmented frames without ever sending a final (fin) frame grows frag_buffer without bound.
In all three cases the attacker only needs to control the WebSocket server the hackney client connects to, with no authentication or special client configuration required.
This issue affects hackney: from 2.0.0-beta.1 before 4.0.1.
NVD (es)
Vulnerabilidad de asignación de recursos sin límites ni limitación en benoitc hackney permite inundación. El cliente WebSocket en src/hackney_ws.erl no impone un límite superior al consumo de memoria en tres rutas de código. Primero, read_handshake_response/3 acumula los bytes recibidos en un búfer creciente sin límite de tamaño; el tiempo de espera por recepción se reinicia en cada fragmento, por lo que un servidor que transmite bytes sin enviar nunca \r\n\r\n hace que el búfer crezca hasta que la memoria se agote. Segundo, parse_payload/9 y parse_active_payload/8 no validan la longitud de la carga útil del marco declarada contra ningún límite; debido a que RFC 6455 permite longitudes de carga útil de hasta 2^63-1 bytes, un servidor que anuncia un marco muy grande y gotea bytes hace que el búfer de acumulación crezca hasta OOM. Tercero, el campo frag_buffer en #ws_data{} acumula marcos de continuación indefinidamente; un servidor que envía un flujo interminable de marcos fragmentados no finales (nofin) sin enviar nunca un marco final (fin) hace crecer frag_buffer sin límite. En los tres casos, el atacante solo necesita controlar el servidor WebSocket al que se conecta el cliente hackney, sin autenticación ni configuración especial del cliente requerida. Este problema afecta a hackney: desde 2.0.0 antes de 4.0.1.
References
| https://github.com/benoitc/hackney/security/advisories/GHSA-q8jg-fgj4-fphf | advisory, exploit, patch, related, vendor-advisory, web | |
| https://cna.erlef.org/cves/CVE-2026-47073.html | patch, related, third-party-advisory, web | |
| https://osv.dev/vulnerability/EEF-CVE-2026-47073 | patch, related, third-party-advisory, web | |
| https://github.com/benoitc/hackney/commit/690cecaf236fba49526da404a5bc889a24367a3e | related, web | |
| https://github.com/benoitc/hackney/commit/ce0109e2970ace6e20ff29bae9d05c3ac22ec6dc | fix, patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-47073 | advisory | |
| https://github.com/benoitc/hackney | package | |
| https://hex.pm/packages/hackney | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-47073 changed 2026-11-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-q8jg-fgj4-fphf changed 2026-06-26 | CC-BY-4.0 |
| Erlang Ecosystem Foundation | EEF-CVE-2026-47073 changed 2026-11-26 | CC-BY-4.0 |
| NVD | CVE-2026-47073 changed 2026-11-20 | Public domain |