ws
8.23.0 · 12 Nov 2026MIT428.4M / weekRepositorynpmAtom feed
7.5.14 is the newest release of 7.x.
In short
2 security
Security
Fixes 1 advisory that affected 7.4.5
- ModerateReDoS in Sec-Websocket-Protocol headerGHSA-6fc8-4gx4-v693 · 28 May 2021Fixed in 7.4.6
2 advisories affect 7.4.6; 7.5.11 fixes them
- Highws: Memory exhaustion DoS from tiny fragments and data chunksGHSA-96hv-2xvq-fx4p · 15 Jun 2026Fixed in 7.5.11
- Highws affected by a DoS when handling a request with many HTTP headersGHSA-3h5v-q93c-6h6q · 17 Jun 2024Fixed in 7.5.10
Release note
Bug fixes
- Security
Fixed a ReDoS vulnerability (00c425e).
A specially crafted value of the Sec-Websocket-Protocol header could be used
to significantly slow down a ws server.
for (const length of [1000, 2000, 4000, 8000, 16000, 32000]) {
const value = 'b' + ' '.repeat(length) + 'x';
const start = process.hrtime.bigint();
value.trim().split(/ *, */);
const end = process.hrtime.bigint();
console.log('length = %d, time = %f ns', length, end - start);
}The vulnerability was responsibly disclosed along with a fix in private by
Robert McLaughlin from University of California, Santa Barbara.
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
and/or the maxHeaderSize options.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.