{"id":"CVE-2021-32640","published":"2021-05-25T18:25:09Z","modified":"2024-08-03T23:25:31Z","title":"ReDoS in Sec-Websocket-Protocol header","vendor":"websockets","product":"ws","tier":"tail","description":{"text":"ws is an open source WebSocket client and server library for Node.js. A specially crafted value of the `Sec-Websocket-Protocol` header can be used to significantly slow down a ws server. The vulnerability has been fixed in ws@7.4.6 (https://github.com/websockets/ws/commit/00c425ec77993773d823f018f64a5c44e17023ff). In vulnerable versions of ws, the issue can be mitigated by reducing the maximum allowed length of the request headers using the [`--max-http-header-size=size`](https://nodejs.org/api/cli.html#cli_max_http_header_size_size) and/or the [`maxHeaderSize`](https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener) options.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.029,"percentile":0.87277,"provenance":"source"},"cwes":[{"id":"CWE-400","name":"Uncontrolled Resource Consumption"}],"references":[{"url":"https://github.com/websockets/ws/security/advisories/GHSA-6fc8-4gx4-v693","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/websockets/ws/commit/00c425ec77993773d823f018f64a5c44e17023ff","tags":["x_refsource_MISC"]},{"url":"https://lists.apache.org/thread.html/rdfa7b6253c4d6271e31566ecd5f30b7ce1b8fb2c89d52b8c4e0f4e30%40%3Ccommits.tinkerpop.apache.org%3E","tags":["mailing-list","x_refsource_MLIST"]},{"url":"https://security.netapp.com/advisory/ntap-20210706-0005/","tags":["x_refsource_CONFIRM"]}],"priority":{"score":21.2,"factors":[{"name":"EPSS percentile","points":17.46},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"websockets","affectedVersions":[{"vendor":"websockets","product":"ws","versions":[">= 5.0.0 <= 7.4.5"]}],"affected":[{"ecosystem":"npm","package":"ws","vulnerableRanges":[">=7.0.0, <7.4.6",">=6.0.0, <6.2.2",">=5.0.0, <5.2.3"],"patched":["7.4.6","6.2.2","5.2.3"],"from":["GHSA-6fc8-4gx4-v693"],"provenance":"source"}],"summary":{"text":"A regular expression denial-of-service (ReDoS) flaw in the ws WebSocket client and server library for Node.js allows a specially crafted Sec-Websocket-Protocol header value to significantly slow down a ws server. An unauthenticated remote attacker with network access can trigger this by sending such a request, with no user interaction or special configuration required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:14:20Z"},"euvd":{"id":"EUVD-2021-0968","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-websockets-ws-cve-2021-32640","children":[{"from":"CVE-2021-32640","to":"CVE-2024-37890","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["lib/websocket-server.js"],"commits":["https://github.com/websockets/ws/commit/00c425ec77993773d823f018f64a5c44e17023ff","https://github.com/websockets/ws/commit/22c28763234aa75a7e1b76f5c01c181260d7917f","https://github.com/websockets/ws/commit/4abd8f6de4b0b65ef80b3ff081989479ed93377e"],"basis":"shared function","functions":["WebSocketServer"]}]}]}}