CVE-2026-47073

Unbounded memory consumption in WebSocket client in hackney

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

Analysis

AI-generated

Technical impact

The WebSocket client in hackney’s src/hackney_ws.erl has three code paths that allow an attacker to grow internal buffers without limit, representing a CWE-400: Uncontrolled Resource Consumption weakness. During a handshake that never sends the \\r\\n\\r\\n terminator, read_handshake_response/3 keeps appending data until memory is exhausted. In the data payload, parse_payload/9 and parse_active_payload/8 accept frame payload lengths up to 2^63-1 bytes without validating them, so a server that advertises an enormous frame and streams it incrementally will cause an out-of-memory condition. Finally, the frag_buffer field in the ws_data struct accumulates continuation frames forever; a server that sends an endless stream of non-final fragmented frames has the client grow its buffer until it runs out of RAM. An attacker only needs to control the WebSocket server, no authentication or special client configuration is required, and the resulting out‑of‑memory can bring the entire process or application down.

Affected Systems

The hackney library, maintained by benoitc, is affected for all versions from 2.0.0-beta.1 up to but excluding 4.0.1. Projects utilizing these versions and engaging in external WebSocket connections are at risk.

Risk and Exploitability

The CVSS score of 8.7 indicates high severity. The EPSS score is less than 1% (approximately 0.00853), indicating a low probability of exploitation but nevertheless noteworthy. The vulnerability is not listed in the CISA KEV catalog; nevertheless, because the attacker only needs to control the server, the attack vector is network-based and does not require authentication or special privileges. If exploited, the client will run out of memory, terminate, and may deny service to the application depending on that connection.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update hackney to version 4.0.1 or later
  • If upgrading is infeasible, place a proxy or firewall in front of the client that limits the maximum data rate or total data volume from untrusted WebSocket servers
  • Add application‑level logic to monitor and cap the buffer size used by hackney, or switch to an alternative WebSocket client that enforces size limits

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

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-q8jg-fgj4-fphf Hackney has unbounded buffer accumulation in WebSocket
History
Type Values Removed Values Added
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 before 4.0.1. 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.
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:N/A:H'}

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 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 before 4.0.1.
Title Unbounded memory consumption in WebSocket client in hackney
First Time appeared Benoitc
Benoitc hackney
Weaknesses CWE-400
CPEs cpe:2.3:a:benoitc:hackney:*:*:*:*:*:*:*:*
Vendors & Products Benoitc
Benoitc hackney
References
Metrics cvssV4_0

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

Weaknesses
  • CWE-400

    Uncontrolled Resource Consumption

Sources

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