Skip to content

chore(deps): bump ws from 8.21.3 to 8.23.0 in /multiplayer in the multiplayer-security group across 1 directory - #12808

Open
dependabot[bot] wants to merge 2 commits into
mainfrom
dependabot/npm_and_yarn/multiplayer/multiplayer-security-dc2cb9fcdf
Open

dependabot[bot] wants to merge 2 commits into
mainfrom
dependabot/npm_and_yarn/multiplayer/multiplayer-security-dc2cb9fcdf

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Bumps the multiplayer-security group with 1 update in the /multiplayer directory: ws.

Updates ws from 8.21.3 to 8.23.0

Release notes

Sourced from ws's releases.

8.23.0

Features

  • Introduced the maxPendingAutoPongs option (ace7248f).

Bug fixes

  • Fixed a remote memory exhaustion DoS vulnerability (ace7248f).

A malicious peer can flood the other peer with Ping frames while stopping reads, forcing it to buffer Pong frames that are automatically sent in response until memory is exhausted, leading to process termination due to OOM.

import { WebSocket, WebSocketServer } from 'ws';
const wss = new WebSocketServer({ port: 0 }, function () {
const data = Buffer.alloc(125);
const { port } = wss.address();
const ws = new WebSocket(ws://localhost:${port});
ws.on('open', function () {
ws.pause();
(function ping() {
  ws.ping(data, function (err) {
    if (err) return;
    ping();
  });
})();

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

The vulnerability was responsibly disclosed by multiple reporters:

... (truncated)

Commits
  • d387219 [dist] 8.23.0
  • ace7248 [security] Limit automatically sent pending pongs
  • 73d283c [test] Ensure DuplexSockets automatically emit the 'close' event
  • 2582a67 [dist] 8.22.2
  • 3eec252 [perf] Do not retain the read buffer via the close reason (#2354)
  • 9757c69 [fix] Do not modify the url.URL object (#2353)
  • e23d55e [fix] Percent-decode the userinfo of the URL (#2352)
  • 335a610 [perf] Do not retain the read buffer via the frame mask (#2350)
  • f40ccff [doc] Adjust Node.js version requirement in README (#2348)
  • c18a80a [dist] 8.22.1
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions
    You can disable automated security fix PRs for this repo from the Security Alerts page.

Summary by cubic

Bumps ws from 8.21.3 to 8.23.0 in the multiplayer service. This fixes a remote memory exhaustion DoS vulnerability where a malicious peer floods Pings, forcing the peer to buffer Pong frames until OOM, and adds the maxPendingAutoPongs option to cap automatic Pong responses.

Adds a regression test that verifies the multiplayer server keeps the default cap and survives a ping flood by terminating the offending connection.

Written for commit 87be969. Summary will update on new commits.

View guided diff Turn on auto-fix

Fixes WIN-2864 — review verdict and test evidence: #12808 (comment)

Bumps the multiplayer-security group with 1 update in the /multiplayer directory: [ws](https://github.com/websockets/ws).


Updates `ws` from 8.21.3 to 8.23.0
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](websockets/ws@8.21.3...8.23.0)

---
updated-dependencies:
- dependency-name: ws
  dependency-version: 8.23.0
  dependency-type: direct:production
  dependency-group: multiplayer-security
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Dec 2, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 87be969
Status: ✅  Deploy successful!
Preview URL: https://0973331e.windmill.pages.dev
Branch Preview URL: https://dependabot-npm-and-yarn-mult-tp7o.windmill.pages.dev

View logs

A peer that floods Pings without reading makes ws queue automatic Pongs
until the server OOMs. ws 8.23.0 terminates such a peer once 60 pongs are
pending; this pins that the multiplayer server keeps that default and
survives the flood. Fails (times out) against ws 8.21.3.

Fixes WIN-2864

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alpetric

alpetric commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Dependabot review — verdict: MERGE WITH THE CHANGES MADE

Fixes WIN-2864. The only change I made is a new regression test (multiplayer/test/ping_flood.test.mjs, commit 87be969). No code changes were needed.

What changed in ws 8.21.3 → 8.23.0

  • 8.22.0: new protocols option. close() with invalid arguments no longer moves the socket to CLOSING.
  • 8.22.1: IPC URL path fix. Uses Node's http.websocketMask/Unmask when available. Sender.frame() no longer returns empty chunks.
  • 8.22.2: URL userinfo is now percent-decoded, and the constructor no longer mutates url.URL objects. Both are client-side only.
  • 8.23.0 (the security fix): new maxPendingAutoPongs option, default 60. When a peer has more than 60 automatic Pongs waiting to be sent, ws now calls terminate() on that connection instead of queueing them without limit.

How we use ws

  • The only runtime user is multiplayer/server.mjs: new WebSocketServer({ server }) with default options. It uses on('message'|'close'|'error'), send, and close(code, reason) with codes 1007, 1009, 4401 and 4403.
  • gateway.mjs proxies raw HTTP upgrades and does not import ws.
  • The frontend uses y-websocket with the browser's native WebSocket, so it does not use ws.
  • ws appears only once in the lockfile: y-websocket does not pull in a second copy.

Is the vulnerability reachable for us?

Yes. Any client holding a multiplayer token, or any connection still waiting for the JWKS fetch, could flood Pings and stop reading. That would crash the multiplayer process with OOM, taking every document and every client with it. The server relies on ws defaults, so the new limit applies without any code change.

Possible breaking changes for us

  • close() argument validation (8.22.0): no impact. All our close codes and reasons are valid.
  • Pong limit: no impact on real clients. Browsers never send WebSocket-level Pings, and the y-websocket client's keep-alive runs on application messages.
  • The other changes affect only the ws client side, which only our tests use.

Testing

Committed test: ping_flood.test.mjs. An authenticated peer pauses reading and floods 125-byte Pings. The test asserts that the server drops it with code 1006, that the process stays alive, and that a new client still completes sync step 2.

  • With ws 8.23.0 it passes in about 120 ms.
  • With ws 8.21.3 (npm i --no-save ws@8.21.3) it fails: the connection is never dropped and the test times out after 15 s. So the test really guards the fix.

Full multiplayer suite (npm ci --omit=dev && npm test, as CI runs it): 16/16 pass on Node 24.15 and on Node 22.23 (npx node@22 --test "test/**/*.test.mjs"). The suite covers cold start and pre-auth buffering, malformed frames, illegal WebSocket frames, socket errors and gateway routing.

By hand: I connected two real y-websocket@3.1.0 WebsocketProvider clients (the library the frontend uses, with ws as the polyfill) to server.mjs on 8.23.0, using a fake JWKS that signs EdDSA tokens.

  • Both clients synced.
  • A text edit from peer 1 reached peer 2.
  • An awareness state (user.name) reached peer 2.
  • A garbage token was closed with 4403, a missing token with 4401, and /__ping__ replied {"type":"pong","service":"multiplayer"}.

Untested

  • I did not run this against a full running backend (the real /api/debug/jwks) or the frontend's collaborative editor, because this worktree's backend would not build after the branch switch. JWT verification is in jwt.mjs and does not use ws. The fake JWKS uses the same EdDSA JWKS format.
  • I did not build the DockerfileExtra image.

CI

No PR check runs this manifest. The multiplayer tests run only in publish_extra.yml (test_extra), which triggers on v* tags or manual dispatch, and dispatching it would publish images. I ran that job's exact command locally instead (see above). Every check that does run on this PR has passed.

What a reviewer should look at

  • multiplayer/server.mjs, around lines 215–310 (WebSocketServer setup and the close codes)
  • multiplayer/test/ping_flood.test.mjs

🤖 Generated with Claude Code

@alpetric

alpetric commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Addendum: tested against a real backend

This fills the gap listed as untested in the review above: the full backend. The verdict stays MERGE WITH THE CHANGES MADE, and nothing new was pushed.

Setup. This worktree's backend (localhost:8120) is built at this branch's base, with migrations applied and EE at ee-repo-ref.txt. server.mjs ran with WINDMILL_BASE_URL pointing at it, so it fetched the real /api/debug/jwks. Tokens were real ones from POST /api/w/admins/debug/sign_multiplayer. The clients were two y-websocket WebsocketProviders.

Check ws 8.23.0 ws 8.21.3
Missing, garbage and wrong-workspace tokens → 4401 / 4403 / 4403 pass pass
__ping__ connectivity probe → {type:"pong"} pass pass
Two providers sync (one through the /ws_mp prefix, with pre-auth replay); a text edit and an awareness state propagate pass pass
A normal client Ping gets its automatic Pong pass pass
Authenticated peer pauses reading and floods 125-byte Pings dropped after 27 ms (1006); server RSS 86 MB → 91 MB; peers keep syncing still connected after 20 s; server RSS 86 MB → 1.9 GB

The 8.21.3 column is the out-of-memory flood reproduced against our own server. It was run with npm i --no-save ws@8.21.3, then npm ci to restore the lockfile.

Pre-auth. I also checked a peer that floods while its token check is still pending (JWKS fetch held). On 8.23.0 it is cut off at the same 60-Pong cap. That variant isn't committed: the cap is per socket and doesn't depend on auth state, so the existing test already guards it.

Still untested: a built windmill-extra image. gateway.mjs doesn't import ws, and the image runs npm ci against this same lockfile.

🤖 Generated with Claude Code

@alpetric

alpetric commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

/review

@claude

claude Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @alpetric's task in 28s —— View job


Good to merge

Summary

  • multiplayer/package.json and package-lock.json: ws goes from ^8.18.0 / 8.21.3 to ^8.23.0 / 8.23.0. Only one copy of ws is resolved, and the lockfile integrity hash comes from the registry. Raising the floor to ^8.23.0 is the right call: a fresh resolve can no longer pick a vulnerable 8.x.

  • multiplayer/server.mjs:215 builds new WebSocketServer({ server }) with default options. So the new maxPendingAutoPongs default of 60 applies with no code change, which closes GHSA-37g9-w4hg-h9qr for us.

  • multiplayer/test/ping_flood.test.mjs is a new regression test. It only uses existing helpers: mintToken, startJwksServer, startMultiplayerServer (with its exitStatus and output), waitFor, plus openClient, hasSyncType and syncStep1Message. Its assertions are sound:

    • the flooding peer is dropped with code 1006, which is how terminate() shows up;
    • the server process is still alive;
    • more than 60 Pings went out, so the cap is what fired and not some other close;
    • a new client still gets sync step 2.

    Every waitFor also stops early if server.exitStatus !== null, so if the server crashes the test fails with the server output instead of just timing out. The header comment states the constraint (don't downgrade ws, don't set maxPendingAutoPongs: 0) without narrating, which matches AGENTS.md.

Findings

None. Since 8.21.3, the breaking surface is close() argument validation and some client-side URL handling. server.mjs only calls close() with valid codes (1007, 1009, 4401, 4403), and our only ws client use is in tests.

AGENTS.md compliance

  • "Ship only the tests the PR needs": the PR adds one small test that pins the security default. According to the earlier comment, it fails against 8.21.3. That fits the rule.
  • No generated files, migrations or frontend changes are involved.

Test coverage

  • What the diff touches: a dependency and config change in the Node multiplayer service. The added test is the right guard.
  • CI: no PR check runs multiplayer/ tests. They only run in publish_extra.yml on tags or manual dispatch. The earlier comment reports the full suite at 16/16 on Node 22 and Node 24.
  • Not run here: I couldn't run the test in this job, because npm ci isn't allowed in this runner.
  • Manual verification: the earlier comment already covers two real y-websocket providers syncing against a real backend's JWKS, and the OOM reproduction on 8.21.3 against 8.23.0. One gap remains, which can wait until after merge: a smoke test of the built windmill-extra image. Open the same flow in two browser tabs with multiplayer on, and confirm that edits show up in both.

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Pi Review

Good to merge

Summary

Dependabot bump of ws 8.21.3 → 8.23.0 in multiplayer/, plus one regression test. The dependency change is confined to the multiplayer service (package.json floor raised to ^8.23.0, lockfile integrity hash from the registry, a single resolved copy of ws). multiplayer/server.mjs builds new WebSocketServer({ server }) with default options, so the new maxPendingAutoPongs default (60) closes GHSA-37g9-w4hg-h9qr with no code change; the only close() call sites use valid codes (1007, 1009, 4401, 4403), so the 8.22.0 close() argument validation does not affect it.

multiplayer/test/ping_flood.test.mjs correctly reproduces the vulnerability and pins the fix: an authenticated peer pause()s its read side and floods 125-byte Pings in a callback recursion, asserts the server terminate()s it (close 1006), that the process is still alive, that more than 60 Pings went out (so the cap, not some other close, is what fired), and that a fresh client still completes sync step 2.

Considered and dismissed

  • cli/package.json still pins ws 8.21.3. Pre-existing and out of scope: this PR is a /multiplayer-scoped dependabot group. The CLI's ws is used only by local dev servers (WebSocketServer on localhost in dev.ts / pipeline/dev.ts / app/dev.ts), not an internet-facing surface, and it is a separate dependency graph not touched by this diff.
  • Test recursion vs. paused reads. ws's ping(data, mask, cb) fires cb when the frame is sent, not when the Pong is received, so the recursion keeps sending while reads are paused — matching the upstream advisory's reproduction exactly. pingsSent will comfortably exceed 60, so the assertion is not flaky.
  • ping(payload, true, cb) argument. true is the mask flag, correct for a client socket.
  • Close code 1006. terminate() drops the TCP connection without a close frame, which ws reports as abnormal closure 1006 — the test's constant is right.
  • Cleanup handlers. t.after(() => offender.ws.terminate()) and healthy.ws.close() are safe on already-closed sockets.
  • AGENTS.md compliance. The single committed test is exactly the regression guard the change warrants ("ship only the tests the PR needs"); the header comment records the durable constraint (don't downgrade ws, don't set maxPendingAutoPongs: 0) without narrating.

Test coverage

This is a dependency + config change and a new Node regression test in the multiplayer service — no Rust backend, no Svelte frontend, no docs to test. The added test is the appropriate guard and was reported to fail against ws 8.21.3 and pass on 8.23.0 (full suite 16/16 on Node 22 and 24).

One caveat: no PR CI check runs multiplayer/ tests — they run only in publish_extra.yml's test_extra job, which triggers on v* tag pushes or manual dispatch, so this regression test will not execute in this PR's checks. The prior reviewer ran the exact CI command locally, plus a real-backend smoke test (two y-websocket providers syncing against a live JWKS, edits/awareness propagating, token rejections, and the OOM reproduction on 8.21.3 vs. 8.23.0). The only remaining unexercised path is the built windmill-extra image; gateway.mjs does not import ws and the image runs npm ci against this same lockfile, so that gap can reasonably wait until after merge — a smoke test of two browser tabs editing the same doc with multiplayer enabled would confirm it.

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Codex Review

Good to merge

No introduced correctness, security, or policy issues found. The manifest and lockfile agree, and the regression exercises the server’s default Pong limit through a real connection.

Test coverage

Independently ran a clean dependency install and the full multiplayer suite from the exact PR snapshot in /tmp: 16/16 passed on Node 22.23.5, including the new flood regression.

Prior discussion documents successful real-backend authentication, synchronization, awareness, and flood A/B testing; I did not repeat those manual checks.

The remaining deployment check is the built windmill-extra image: open the same flow in two browser tabs with multiplayer enabled and confirm edits propagate.

@alpetric

alpetric commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

✅ Review round clean @ 87be969

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant