Skip to content

chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] - #459

Open
renovate[bot] wants to merge 1 commit into
developmentfrom
renovate/npm-ws-vulnerability
Open

chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY]#459
renovate[bot] wants to merge 1 commit into
developmentfrom
renovate/npm-ws-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
ws ^8.18.0^8.20.1 age confidence

ws affected by a DoS when handling a request with many HTTP headers

CVE-2024-37890 / GHSA-3h5v-q93c-6h6q

More information

Details

Impact

A request with a number of headers exceeding the server.maxHeadersCount threshold could be used to crash a ws server.

Proof of concept
const http = require('http');
const WebSocket = require('ws');

const wss = new WebSocket.Server({ port: 0 }, function () {
  const chars = "!#$%&'*+-.0123456789abcdefghijklmnopqrstuvwxyz^_`|~".split('');
  const headers = {};
  let count = 0;

  for (let i = 0; i < chars.length; i++) {
    if (count === 2000) break;

    for (let j = 0; j < chars.length; j++) {
      const key = chars[i] + chars[j];
      headers[key] = 'x';

      if (++count === 2000) break;
    }
  }

  headers.Connection = 'Upgrade';
  headers.Upgrade = 'websocket';
  headers['Sec-WebSocket-Key'] = 'dGhlIHNhbXBsZSBub25jZQ==';
  headers['Sec-WebSocket-Version'] = '13';

  const request = http.request({
    headers: headers,
    host: '127.0.0.1',
    port: wss.address().port
  });

  request.end();
});
Patches

The vulnerability was fixed in ws@8.17.1 (websockets/ws@e55e510) and backported to ws@7.5.10 (websockets/ws@22c2876), ws@6.2.3 (websockets/ws@eeb76d3), and ws@5.2.4 (websockets/ws@4abd8f6).

Workarounds

In vulnerable versions of ws, the issue can be mitigated in the following ways:

  1. Reduce the maximum allowed length of the request headers using the --max-http-header-size=size and/or the maxHeaderSize options so that no more headers than the server.maxHeadersCount limit can be sent.
  2. Set server.maxHeadersCount to 0 so that no limit is applied.
Credits

The vulnerability was reported by Ryan LaPointe in https://github.com/websockets/ws/issues/2230.

References

Severity

  • CVSS Score: 8.7 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


ReDoS in Sec-Websocket-Protocol header

CVE-2021-32640 / GHSA-6fc8-4gx4-v693

More information

Details

Impact

A specially crafted value of the Sec-Websocket-Protocol header can be used to significantly slow down a ws server.

Proof of concept
for (const length of [1000, 2000, 4000, 8000, 16000, 32000]) {
  const value = 'b' + ' '.repeat(length) + 'x';
  const start = process.hrtime.bigint();

  value.trim().split(/ *, */);

  const end = process.hrtime.bigint();

  console.log('length = %d, time = %f ns', length, end - start);
}
Patches

The vulnerability was fixed in ws@7.4.6 (websockets/ws@00c425e) and backported to ws@6.2.2 (websockets/ws@78c676d) and ws@5.2.3 (websockets/ws@76d47c1).

Workarounds

In vulnerable versions of ws, the issue can be mitigated by reducing the maximum allowed length of the request headers using the --max-http-header-size=size and/or the maxHeaderSize options.

Credits

The vulnerability was responsibly disclosed along with a fix in private by Robert McLaughlin from University of California, Santa Barbara.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


ws: Uninitialized memory disclosure

CVE-2026-45736 / GHSA-58qx-3vcg-4xpx

More information

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 ws@8.20.1 (websockets/ws@c0327ec).

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

Severity

  • CVSS Score: 4.4 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

websockets/ws (ws)

v8.20.1

Compare Source

Bug fixes
  • Fixed an uninitialized memory disclosure issue in websocket.close()
    (c0327ec).

Providing a TypedArray (e.g. Float32Array) as the reason argument for
websocket.close(), rather than the supported string or Buffer types, caused
uninitialized memory to be disclosed to the remote peer.

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));
});

The issue was privately reported by Nikita Skovoroda.

v8.20.0

Compare Source

Features
  • Added exports for the PerMessageDeflate class and utilities for the
    Sec-WebSocket-Extensions and Sec-WebSocket-Protocol headers (d3503c1).

v8.19.0

Compare Source

Features
  • Added the closeTimeout option (#​2308).
Bug fixes
  • Handled a forthcoming breaking change in Node.js core (1998485).

v8.18.3

Compare Source

Bug fixes
  • Fixed a spec violation where the Sec-WebSocket-Version header was not added
    to the HTTP response if the client requested version was either invalid or
    unacceptable (#​2291).

v8.18.2

Compare Source

Bug fixes
  • Fixed an issue that, during message decompression when the maximum size was
    exceeded, led to the emission of an inaccurate error and closure of the
    connection with an improper close code (#​2285).

v8.18.1

Compare Source

Bug fixes
  • The length of the UNIX domain socket paths in the tests has been shortened to
    make them work when run via CITGM (021f7b8).

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the renovate-bot Renovate PR label Aug 26, 2026
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nexeraid-example-airdrop-v2 Ready Ready Preview Sep 10, 2026 10:50pm UTC
nexeraid-examples-v2 Ready Ready Preview Sep 10, 2026 10:50pm UTC
thea-examples Error Error Sep 10, 2026 10:50pm UTC

Request Review

@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] Aug 27, 2026
@renovate
renovate Bot force-pushed the renovate/npm-ws-vulnerability branch from 0aa1e3e to 7103681 Compare August 27, 2026 01:43
@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] Sep 2, 2026
@renovate
renovate Bot force-pushed the renovate/npm-ws-vulnerability branch from 7103681 to b450178 Compare September 2, 2026 20:44
@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] Sep 3, 2026
@renovate
renovate Bot force-pushed the renovate/npm-ws-vulnerability branch from b450178 to 124cb70 Compare September 3, 2026 04:07
@renovate
renovate Bot force-pushed the renovate/npm-ws-vulnerability branch from 124cb70 to ad70e92 Compare September 3, 2026 17:59
@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] Sep 3, 2026
@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] Sep 8, 2026
@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] Sep 8, 2026
@renovate
renovate Bot force-pushed the renovate/npm-ws-vulnerability branch from 7ddaecc to 6cf5011 Compare September 8, 2026 04:52
@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] Sep 9, 2026
@renovate
renovate Bot force-pushed the renovate/npm-ws-vulnerability branch from 6cf5011 to b3f6fd0 Compare September 9, 2026 23:36
@renovate
renovate Bot force-pushed the renovate/npm-ws-vulnerability branch from b3f6fd0 to b4b8d4b Compare September 10, 2026 04:24
@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] Sep 10, 2026
@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] Sep 10, 2026
@renovate
renovate Bot force-pushed the renovate/npm-ws-vulnerability branch from b4b8d4b to 19d37b9 Compare September 10, 2026 15:53
…URITY]

See associated pull request for more information.
@renovate renovate Bot changed the title chore(renovate): Security update Update dependency ws to ^8.21.3 [SECURITY] chore(renovate): Security update Update dependency ws to ^8.20.1 [SECURITY] Sep 10, 2026
@renovate
renovate Bot force-pushed the renovate/npm-ws-vulnerability branch from 19d37b9 to a1b6bc9 Compare September 10, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

renovate-bot Renovate PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants