CVE-2026-45736: Ws Uninitialized Memory Disclosure Vulnerability
MODERATECVE-2026-45736 is a MODERATE (CVSS 4.4) uninitialized memory disclosure vulnerability (CWE-908: Use of Uninitialized Resource) affecting Ws libraries in the npm ecosystem. The issue involves uninitialized memory disclosure. Remediation is available by upgrading affected packages to version 8.20.1.
CVE-2026-45736 at a Glance
Security Impact
CVSS: 4.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2026-45736
To remediate this vulnerability, upgrade all affected Ws dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install ws@8.20.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls ws
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-45736, inspect your project dependencies using npm:
npm ls ws
Analyze the terminal output to locate any version of Ws in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.20.1), your application is affected.
Note: The npm ls ws command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-908: Use of Uninitialized Resource, where the product uses or accesses a resource that has not been initialized. In Ws, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-45736 Affected Ws Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ws
|
npm |
≥ 8.0.0
< 8.20.1
|
8.20.1
|
References
Frequently Asked Questions
What is CVE-2026-45736?
Which Ws versions are affected?
What version fixes CVE-2026-45736?
Is ws affected?
What is the CVSS score of CVE-2026-45736?
What CWE is associated with CVE-2026-45736?
How can I check npm dependencies for CVE-2026-45736?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-58qx-3vcg-4xpx",
"modified" : "2026-05-18T19:02:40Z",
"published" : "2026-05-18T19:02:40Z",
"aliases" : [ "CVE-2026-45736" ],
"summary" : "ws: Uninitialized memory disclosure",
"details" : "### Impact\n\nThe `websocket.close()` implementation is vulnerable to uninitialized memory disclosure when a `TypedArray` is passed as the reason argument.\n\n### Proof of concept\n\n```js\nimport { deepStrictEqual } from 'node:assert';\nimport { WebSocket, WebSocketServer } from 'ws';\n\nconst wss = new WebSocketServer(\n { port: 0, skipUTF8Validation: true },\n function () {\n const { port } = wss.address();\n const ws = new WebSocket(`ws://localhost:${port}`, {\n skipUTF8Validation: true\n });\n\n ws.on('close', function (code, reason) {\n deepStrictEqual(reason, Buffer.alloc(80));\n });\n }\n);\n\nwss.on('connection', function (ws) {\n ws.close(1000, new Float32Array(20));\n});\n```\n\n### Patches\n\nThe vulnerability was fixed in ws@8.20.1 (https://github.com/websockets/ws/commit/c0327ec15a54d701eb6ccefaa8bef328cfc03086).\n\n### Credits\n\nCredit for the private and responsible disclosure of this issue goes to [Nikita Skovoroda](https://github.com/ChALkeR).\n\n### Remarks\n\nAlthough 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.\n\n### Resources\n\n- https://github.com/advisories/GHSA-58qx-3vcg-4xpx\n- https://www.cve.org/CVERecord?id=CVE-2026-45736",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "ws"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.20.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/websockets/ws/security/advisories/GHSA-58qx-3vcg-4xpx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45736"
}, {
"type" : "WEB",
"url" : "https://github.com/websockets/ws/commit/c0327ec15a54d701eb6ccefaa8bef328cfc03086"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/websockets/ws"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-908" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-18T19:02:40Z",
"nvd_published_at" : "2026-05-15T15:16:54Z"
}
}