ws
8.23.0 · 12 Nov 2026MIT428.4M / weekRepositorynpmAtom feed
Your version
8.23.0 is the newest release of 8.x.
In short
1 fixed
Security
Fixes 1 advisory that affected 8.20.0
- Moderatews: Uninitialized memory disclosureGHSA-58qx-3vcg-4xpx · 18 May 2026Fixed in 8.20.1
1 advisory affects 8.20.1; 8.21.0 fixes them
- Highws: Memory exhaustion DoS from tiny fragments and data chunksGHSA-96hv-2xvq-fx4p · 15 Jun 2026Fixed in 8.21.0
Release note
Bug fixes
Fixed an uninitialized memory disclosure issue in
websocket.close()
(c0327ec).
Providing a TypedArray (e.g. Float32Array) as the reason argument forwebsocket.close(), rather than the supported string or Buffer types, caused
uninitialized memory to be disclosed to the remote peer.
import { deepStrictEqual } from 'node:assert';
import { WebSocket, WebSocketServer } from 'ws';
const wss = new WebSocketServer(
{ port: 0, skipUTF8Validation: true },
function () {
const { port } = wss.address();
const ws = new WebSocket(`ws://localhost:${port}`, {
skipUTF8Validation: true
});
ws.on('close', function (code, reason) {
deepStrictEqual(reason, Buffer.alloc(80));
});
}
);
wss.on('connection', function (ws) {
ws.close(1000, new Float32Array(20));
});The issue was privately reported by Nikita Skovoroda.
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.