{"id":"UBUNTU-CVE-2021-32640","details":"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.","modified":"2025-10-24T04:50:20Z","published":"2021-05-25T19:15:00Z","upstream":["CVE-2021-32640"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2021-32640"},{"type":"REPORT","url":"https://github.com/websockets/ws/security/advisories/GHSA-6fc8-4gx4-v693"},{"type":"REPORT","url":"https://github.com/websockets/ws/commit/00c425ec77993773d823f018f64a5c44e17023ff"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2021-32640"}],"affected":[{"package":{"name":"node-ws","ecosystem":"Ubuntu:16.04:LTS","purl":"pkg:deb/ubuntu/node-ws@1.0.1+ds1.e6ddaae4-1?arch=source&distro=xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.7.2+ds1.349b7460-1","1.0.1+ds1.e6ddaae4-1"],"ecosystem_specific":{"binaries":[{"binary_version":"1.0.1+ds1.e6ddaae4-1","binary_name":"node-ws"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-32640.json"}},{"package":{"name":"node-ws","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/node-ws@1.1.0+ds1.e6ddaae4-3ubuntu1?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.1.0+ds1.e6ddaae4-3build1","1.1.0+ds1.e6ddaae4-3ubuntu1"],"ecosystem_specific":{"binaries":[{"binary_name":"node-ws","binary_version":"1.1.0+ds1.e6ddaae4-3ubuntu1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-32640.json"}},{"package":{"name":"node-ws","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/node-ws@7.2.1-3?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.1.0+ds1.e6ddaae4-5","7.2.1-2","7.2.1-3"],"ecosystem_specific":{"binaries":[{"binary_name":"node-ws","binary_version":"7.2.1-3"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-32640.json"}},{"package":{"name":"node-ws","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/node-ws@8.5.0+~cs13.3.3-2?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["7.4.2+~cs18.0.8-2","7.5.5+~cs13.0.13-1","8.5.0+~cs13.3.3-2"],"ecosystem_specific":{"binaries":[{"binary_name":"node-ws","binary_version":"8.5.0+~cs13.3.3-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-32640.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},{"type":"Ubuntu","score":"medium"}]}