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.
Github GHSA