Skip to content

[Snyk] Upgrade ws from 8.17.1 to 8.18.3#28

Merged
SMSDAO merged 1 commit intomainfrom
snyk-upgrade-a52fa42ec4fa3428b8c888b9ba397461
Dec 25, 2025
Merged

[Snyk] Upgrade ws from 8.17.1 to 8.18.3#28
SMSDAO merged 1 commit intomainfrom
snyk-upgrade-a52fa42ec4fa3428b8c888b9ba397461

Conversation

@SMSDAO
Copy link
Contributor

@SMSDAO SMSDAO commented Dec 19, 2025

snyk-top-banner

Snyk has created this PR to upgrade ws from 8.17.1 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 4 versions ahead of your current version.

  • The recommended version was released 6 months ago.

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 (#2291).
  • 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.
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.

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.17.1 to 8.18.3.

See this package in npm:
ws

See this project in Snyk:
https://app.snyk.io/org/smsdao/project/ffeb0825-db09-4184-b290-ff207397c5a2?utm_source=github&utm_medium=referral&page=upgrade-pr
Copilot AI review requested due to automatic review settings December 19, 2025 04:19
@github-actions
Copy link

📢 New Pull Request Ready for Review

Title: [Snyk] Upgrade ws from 8.17.1 to 8.18.3
Author: @SMSDAO
Branch: snyk-upgrade-a52fa42ec4fa3428b8c888b9ba397461main

Please review when you have a chance! 🚀

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the ws WebSocket library from version 8.17.1 to 8.18.3, addressing security vulnerabilities and incorporating bug fixes from four intermediate releases. The upgrade is automatically generated by Snyk to keep dependencies up-to-date.

Key Changes:

  • Upgrades ws package from ^8.14.2/8.17.1 to ^8.18.3
  • Updates package-lock.json with new version, resolved URL, and integrity hash

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
package.json Updates the ws dependency version constraint to ^8.18.3
package-lock.json Updates the locked ws version to 8.18.3 with corresponding integrity hash and registry URL

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SMSDAO SMSDAO merged commit 5c996df into main Dec 25, 2025
39 of 48 checks passed
@SMSDAO SMSDAO deleted the snyk-upgrade-a52fa42ec4fa3428b8c888b9ba397461 branch December 25, 2025 04:54
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.

3 participants