Upgrading ws 4 to 5
Breaking4.1.0 → 5.2.7Breaking2Security3Platform1New3Fixed9
SecurityHigh · CVSS 7.5ws: Memory exhaustion DoS from tiny fragments and data chunksGHSA-96hv-2xvq-fx4p · CVE-2026-48779 ↗
BreakingUpgrade verdict
2 breaking changes and a platform requirement change and 3 security fixes.
In plain terms
- If the server picks none of the subprotocols the client asked for, the connection now stays open instead of being closed.
- Errors from the underlying network socket are no longer passed on as re-emitted errors.
- The package no longer works on very old versions of Node.js; you need Node.js 4.5.0 or newer.
- ws: Memory exhaustion DoS from tiny fragments and data chunks
Must act Top 5 of 6 that need code or config changes
Drops safe-buffer.
Installs 1 package in all (was 2).
What you must change
Breaking2
The connection is no longer closed when the server does not agree to any of the client's requested subprotocols.
net.Socket errors are no longer re-emitted.
net.SocketSecurity3
ws: Memory exhaustion DoS from tiny fragments and data chunks
High · CVSS 7.5ws affected by a DoS when handling a request with many HTTP headers
High · CVSS 7.5ReDoS in Sec-Websocket-Protocol header
Moderate · CVSS 5.3Platform1
Drops support for Node.js versions below 4.5.0.