Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

chore(deps): update dependency ws to v7.4.6 [security] #513

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 28, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
ws 7.3.1 -> 7.4.6 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2021-32640

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.


Release Notes

websockets/ws (ws)

v7.4.6

Compare Source

Bug fixes

  • Fixed a ReDoS vulnerability (00c425e).

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

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

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

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.

v7.4.5

Compare Source

Bug fixes

  • UTF-8 validation is now done even if utf-8-validate is not installed
    (23ba6b2).
  • Fixed an edge case where websocket.close() and websocket.terminate() did
    not close the connection (67e25ff).

v7.4.4

Compare Source

Bug fixes

  • Fixed a bug that could cause the process to crash when using the
    permessage-deflate extension (9277437).

v7.4.3

Compare Source

Bug fixes

  • The deflate/inflate stream is now reset instead of reinitialized when context
    takeover is disabled (#​1840).

v7.4.2

Compare Source

Bug fixes

  • Silenced a deprecation warning (a2c0d44).

v7.4.1

Compare Source

Bug fixes

  • Added a workaround for a double 'error' event bug in Node.js < 13 which
    caused an uncaught error during the WebSocket handshake (38d6ab3).

v7.4.0

Compare Source

Features

  • The callback of WebSocketServer.prototype.handleUpgrade() now takes the
    client HTTP GET request as second argument (7d39f19).

Bug fixes

  • Read-only properties are now read-only (eabed8f).
  • The CONNECTING, OPEN, CLOSING, CLOSED, binaryType, bufferedAmount,
    extensions, onclose, onerror, onmessage, onopen, protocol,
    readyState, and url properties are now enumerable (2069e68).

Configuration

πŸ“… Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

β™» 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 has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from dd996e2 to 2a38d56 Compare June 4, 2023 10:45
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 2a38d56 to 193ac46 Compare June 29, 2023 09:17
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 193ac46 to cc8a65e Compare July 19, 2023 10:35
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from cc8a65e to 7dae1bc Compare July 27, 2023 18:32
@renovate renovate bot force-pushed the renovate/npm-ws-vulnerability branch from 7dae1bc to d369227 Compare August 22, 2023 21:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants