CVE-2026-45736: ws: Uninitialized memory disclosure

Published May 15, 2026
·
Updated

Impact

The websocket.close() implementation is vulnerable to uninitialized memory disclosure when a TypedArray is passed as the reason argument.

Proof of concept

js 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 ws@8.20.1 (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

- https://github.com/advisories/GHSA-58qx-3vcg-4xpx - https://www.cve.org/CVERecord?id=CVE-2026-45736

Other sources

ws is an open source WebSocket client and server for Node.js. Prior to 8.20.1, the websocket.close() implementation is vulnerable to uninitialized memory disclosure when a TypedArray is passed as the reason argument. This vulnerability is fixed in 8.20.1.

NVD

Affected Software

3 affected componentsFixes available
npm/ws<8.20.1
npm/ws>=8.0.0<8.20.1
8.20.1
Ws Project Ws Node.js>=8.0.0<8.20.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/ws to a version that resolves this vulnerability.

    Fixed in 8.20.1
  2. Upgrade

    Upgrade ws to a version that resolves this vulnerability.

    Fixed in 8.20.1

Event History

May 15, 2026
CVE Published
via MITRE·02:53 PM
Data Sourced
via MITRE·02:53 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·04:01 PM
DescriptionSeverityAffected Software
May 18, 2026
Advisory Published
via GitHub·07:02 PM
Data Sourced
via GitHub·07:02 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-45736?

CVE-2026-45736 has a high severity rating due to its potential for memory disclosure risks.

2

How do I fix CVE-2026-45736?

To fix CVE-2026-45736, you need to upgrade the ws package to version 8.20.1 or later.

3

What type of software is affected by CVE-2026-45736?

CVE-2026-45736 affects the ws library, which is a WebSocket client and server for Node.js.

4

What is the nature of the vulnerability in CVE-2026-45736?

CVE-2026-45736 involves uninitialized memory disclosure when a TypedArray is passed as the reason argument in websocket.close().

5

When was CVE-2026-45736 fixed?

CVE-2026-45736 was fixed in version 8.20.1 of the ws library.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203