Skip to content
OpenAdvisories
Medium · 5.3 CVE-2021-32640 EUVD-2021-0968GHSA-6fc8-4gx4-v693

ReDoS in Sec-Websocket-Protocol header

Published May 25, 2021 · Updated Aug 3, 2024 · Assigned by GitHub_M

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 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.

Affected products

VendorProductAffectedFixed
websockets ws >= 5.0.0 <= 7.4.5 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 node-ws 7.4.2+~cs18.0.8-2 —
Debian 13 node-ws 7.4.2+~cs18.0.8-2 —
Debian 12 node-ws 7.4.2+~cs18.0.8-2 —
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS node-ws No fix yet —
Ubuntu 20.04 LTS node-ws No fix yet —
Ubuntu 18.04 LTS node-ws No fix yet —
Ubuntu 16.04 LTS node-ws No fix yet —

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 js-jquery No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
npm ws >= 7.0.0, < 7.4.6 7.4.6 GHSA-6fc8-4gx4-v693
npm ws >= 6.0.0, < 6.2.2 6.2.2 GHSA-6fc8-4gx4-v693
npm ws >= 5.0.0, < 5.2.3 5.2.3 GHSA-6fc8-4gx4-v693

Advisories 1

References