Skip to content

Update npm package ws to v8.20.1 [SECURITY]#8740

Open
hash-worker[bot] wants to merge 1 commit into
mainfrom
deps/js/npm-ws-vulnerability
Open

Update npm package ws to v8.20.1 [SECURITY]#8740
hash-worker[bot] wants to merge 1 commit into
mainfrom
deps/js/npm-ws-vulnerability

Conversation

@hash-worker
Copy link
Copy Markdown
Contributor

@hash-worker hash-worker Bot commented May 22, 2026

This PR contains the following updates:

Package Change Age Confidence
ws 8.18.38.20.1 age confidence

Warning

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

GitHub Vulnerability Alerts

CVE-2026-45736

Impact

The websocket.close() implementation is vulnerable to uninitialized memory disclosure when a TypedArray is passed as the reason argument.

Proof of concept

import { deepStrictEqual } from 'node:assert';
import { WebSocket, WebSocketServer } from 'ws';

const wss = new WebSocketServer(
  { port: 0, skipUTF8Validation: true },
  function () {
    const { port } = wss.address();
    const ws = new WebSocket(`ws://localhost:${port}`, {
      skipUTF8Validation: true
    });

    ws.on('close', function (code, reason) {
      deepStrictEqual(reason, Buffer.alloc(80));
    });
  }
);

wss.on('connection', function (ws) {
  ws.close(1000, new Float32Array(20));
});

Patches

The vulnerability was fixed in ws@8.20.1 (websockets/ws@c0327ec).

Credits

Credit for the private and responsible disclosure of this issue goes to Nikita Skovoroda.

Remarks

Although the calculated CVSS severity is medium, the actual severity is believed to be low, as the flaw is only exploitable through misuse that is unlikely in practice.

Resources


Release Notes

websockets/ws (ws)

v8.20.1

Compare Source

Bug fixes
  • Fixed an uninitialized memory disclosure issue in websocket.close()
    (c0327ec).

Providing a TypedArray (e.g. Float32Array) as the reason argument for
websocket.close(), rather than the supported string or Buffer types, caused
uninitialized memory to be disclosed to the remote peer.

import { deepStrictEqual } from 'node:assert';
import { WebSocket, WebSocketServer } from 'ws';

const wss = new WebSocketServer(
  { port: 0, skipUTF8Validation: true },
  function () {
    const { port } = wss.address();
    const ws = new WebSocket(`ws://localhost:${port}`, {
      skipUTF8Validation: true
    });

    ws.on('close', function (code, reason) {
      deepStrictEqual(reason, Buffer.alloc(80));
    });
  }
);

wss.on('connection', function (ws) {
  ws.close(1000, new Float32Array(20));
});

The issue was privately reported by Nikita Skovoroda.

v8.20.0

Compare Source

Features
  • Added exports for the PerMessageDeflate class and utilities for the
    Sec-WebSocket-Extensions and Sec-WebSocket-Protocol headers (d3503c1).

v8.19.0

Compare Source

Features
  • Added the closeTimeout option (#​2308).
Bug fixes
  • Handled a forthcoming breaking change in Node.js core (1998485).

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • "before 4am every weekday,every weekend"

🚦 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 this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@hash-worker hash-worker Bot enabled auto-merge May 22, 2026 12:24
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Error Error May 23, 2026 12:36pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview May 23, 2026 12:36pm
petrinaut Skipped Skipped May 23, 2026 12:36pm

@hash-worker
Copy link
Copy Markdown
Contributor Author

hash-worker Bot commented May 22, 2026

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: yarn.lock
error This project's package.json defines "packageManager": "yarn@4.12.0". However the current global version of Yarn is 1.22.22.

Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.

@cursor
Copy link
Copy Markdown

cursor Bot commented May 22, 2026

PR Summary

Low Risk
Low risk dependency bump affecting WebSocket behavior only; should mainly be a security/bugfix update but could surface subtle runtime differences in WS close/error handling.

Overview
Updates the ws dependency from 8.18.3 to 8.20.1 in apps/hash-api and apps/plugin-browser to pick up the upstream security fix for websocket.close() uninitialized memory disclosure when misused with TypedArray reasons.

Reviewed by Cursor Bugbot for commit ba7d376. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) type/eng > backend Owned by the @backend team area/apps labels May 22, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 22, 2026

🤖 Augment PR Summary

Summary: Updates the pinned ws dependency to 8.20.1 in apps/hash-api and apps/plugin-browser to address a security advisory.

Changes:

  • Bumped ws from 8.18.38.20.1 in both app package manifests (includes the fix for the websocket.close() uninitialized-memory disclosure when misused with a TypedArray reason).

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ba7d376. Configure here.

"tsx": "4.20.6",
"typescript": "5.9.3",
"ws": "8.18.3"
"ws": "8.20.1"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lockfile still pins vulnerable ws

Medium Severity

This PR bumps ws to 8.20.1 in both workspace manifests, but yarn.lock still resolves @apps/hash-api and @apps/plugin-browser to ws@8.18.3. Yarn Berry installs from the lockfile, so the CVE fix may not land until the lockfile is regenerated and committed with the manifest changes.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ba7d376. Configure here.

@hash-worker hash-worker Bot changed the title Update npm package ws to v8.20.1 [SECURITY] Update npm package ws to v8.20.1 [SECURITY] - autoclosed May 23, 2026
@hash-worker hash-worker Bot closed this May 23, 2026
auto-merge was automatically disabled May 23, 2026 11:12

Pull request was closed

@hash-worker hash-worker Bot deleted the deps/js/npm-ws-vulnerability branch May 23, 2026 11:12
@hash-worker hash-worker Bot changed the title Update npm package ws to v8.20.1 [SECURITY] - autoclosed Update npm package ws to v8.20.1 [SECURITY] May 23, 2026
@hash-worker hash-worker Bot reopened this May 23, 2026
@hash-worker hash-worker Bot force-pushed the deps/js/npm-ws-vulnerability branch 2 times, most recently from ba7d376 to ba52300 Compare May 23, 2026 12:35
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 23, 2026 12:35 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps area/deps Relates to third-party dependencies (area) type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

1 participant