websocket-driver: Memory exhaustion triggered by buffering of data received after socket is closed
Published 1 Dec 2026 · Updated 1 Dec 2026
Affected package
- Affected
- <0.9.1
- Fixed in
- 0.9.1
bundle update --conservative websocket-driver # Gemfile: '>= 0.9.1'Which websocket-driver does your project really install?
Works for private projects: the file is read in memory to run the scan and then dropped. Also reads Gemfile.
Public repo?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Details
Summary
A WebSocket server implemented using websocket-driver can be made to buffer data in memory indefinitely by a client that connects, sends a single close frame, and then leaves its side of the connection open while it continues to send more data over the connection.
Details
When used as documented, a server handles WebSocket connections by piping all bytes received over a TCP socket into the driver object provided by this library. On receipt of a WebSocket close frame, the driver emits a close event, which the caller should handle by closing the TCP socket. However, since TCP allows sockets to remain half-open, the client can keep its side of the socket open and keep sending data. Due to the state the driver enters after the close event, this data will be buffered in memory but never consumed by the parser. An attacker can exploit this by sending an indefinite stream of bytes over the socket until it causes the server to run out of memory.
This has been mitigated by destroying the buffer when the socket undergoes any failure event, including an explicit close. The buffer is dereferenced and no further data will be added to it, and it should eventually be garbage collected along with the rest of the connection objects.
Impact
A server using websocket-driver can be made to run out of memory and crash by an unauthenticated remote attacker by sending sufficient data over a single socket.
Is GHSA-7c6x-34q5-4g2j in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected websocket-driver, and gives you the command that fixes it.
More advisories for websocket-driver
- CriticalCVE-2026-140016websocket-driver: Message corruption and denial of service triggered by crafted client message · 1 Dec 2026
- HighCVE-2026-140011permessage-deflate-ruby: Memory exhaustion triggered by message decompression · 1 Dec 2026
- HighCVE-2026-61666websocket-driver-ruby: Denial of service via malformed Host header · 21 Jul 2026
- MediumCVE-2026-54465websocket-driver: Memory exhaustion in HTTP header parser · 15 Jul 2026
- MediumCVE-2026-54464websocket-driver: Resource limit bypass via message compression · 15 Jul 2026
- MediumCVE-2026-54463websocket-driver: Memory exhaustion via abuse of protocol length headers · 15 Jul 2026
References
- Linkgithub.com/faye/websocket-driver-ruby/security/advisories/GHSA-7c6x-34q5-4g2j
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-140015
- Linkgithub.com/faye/websocket-driver-ruby/commit/a8085fea980c971cad4dea817183c42efd2290c2
- Packagegithub.com/faye/websocket-driver-ruby
- Linkgithub.com/faye/websocket-driver-ruby/releases/tag/0.9.1
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.