{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-32640","id":"CVE-2021-32640","title":"ReDoS in Sec-Websocket-Protocol header","description":"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 all","descriptionLong":"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.","published":"2021-05-25T18:25:09.000Z","updated":"2026-10-20T10:54:41.779792870Z","reserved":"2021-05-12T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"GitHub_M"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"github.com"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"NVD"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"OSV"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"GitHub"},{"version":"2.0","score":5,"vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","rating":"medium","source":"NVD"}],"rating":"medium","products":["websockets ws"],"affectedProducts":[{"vendor":"websockets","product":"ws","defaultStatus":null,"versions":[{"status":"affected","version":">= 5.0.0 <= 7.4.5"}],"platforms":[]}],"packages":[{"ecosystem":"npm","name":"ws","purl":"pkg:npm/ws","ranges":[">=7.0.0 <7.4.6",">=6.0.0 <6.2.2",">=5.0.0 <5.2.3"],"fixed":["7.4.6","6.2.2","5.2.3"],"advisory":"GHSA-6fc8-4gx4-v693"}],"cwes":["CWE-400","CWE-345"],"aliases":["GHSA-6fc8-4gx4-v693"],"references":[{"url":"https://github.com/websockets/ws/security/advisories/GHSA-6fc8-4gx4-v693","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Mitigation","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/websockets/ws/commit/00c425ec77993773d823f018f64a5c44e17023ff","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://lists.apache.org/thread.html/rdfa7b6253c4d6271e31566ecd5f30b7ce1b8fb2c89d52b8c4e0f4e30%40%3Ccommits.tinkerpop.apache.org%3E","tags":["mailing-list","x_refsource_MLIST","x_transferred","web"]},{"url":"https://security.netapp.com/advisory/ntap-20210706-0005/","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32640","tags":["advisory"]},{"url":"https://github.com/websockets/ws/issues/1895","tags":["web"]},{"url":"https://github.com/websockets/ws","tags":["package"]},{"url":"https://lists.apache.org/thread.html/rdfa7b6253c4d6271e31566ecd5f30b7ce1b8fb2c89d52b8c4e0f4e30@%3Ccommits.tinkerpop.apache.org%3E","tags":["web"]},{"url":"https://security.netapp.com/advisory/ntap-20210706-0005","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.02821,"epssPercentile":0.86871,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-32640","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32640","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-32640","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-6fc8-4gx4-v693","ok":true,"note":"GHSA-6fc8-4gx4-v693"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-32640","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}