Skip to content

fix: bump ws dependency to ^8.21.1 (CVE-2026-48779) - #10854

Merged
joehan merged 1 commit into
mainfrom
update-ws-dependency
Jul 27, 2026
Merged

fix: bump ws dependency to ^8.21.1 (CVE-2026-48779)#10854
joehan merged 1 commit into
mainfrom
update-ws-dependency

Conversation

@joehan

@joehan joehan commented Jul 27, 2026

Copy link
Copy Markdown
Member

Description

Taking over #10817

Upgrades ws from ^7.5.10 to ^8.21.1 and @types/ws to ^8.18.1 to resolve security vulnerability CVE-2026-48779. Also regenerates the shrinkwrap file npm-shrinkwrap.json to lock the upgraded versions.
Verified that the breaking changes in ws version 8 do not break any functionality in firebase-tools:

  • WebSocketServer.prototype.close() no longer closes existing connections automatically, but LoggingEmulator already manually terminates all active socket connections when stopped.
  • Text messages and close reasons are no longer decoded to strings but passed as Buffers; since the emulator does not listen to 'message' events and the 'close' listener does not read the close reason argument, this does not affect us.

Scenarios Tested

  • Added unit test src/emulator/loggingEmulator.spec.ts verifying that LoggingEmulator starts and broadcasts log messages correctly via WebSocket.
  • Ran mocha test suite.

Sample Commands

npx mocha src/emulator/loggingEmulator.spec.ts

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the ws dependency and its types to version 8, and introduces a new unit test suite for the LoggingEmulator to verify that it starts and broadcasts log messages correctly. The review feedback suggests improving test cleanup by declaring the WebSocket client at the suite level and closing it in the afterEach hook to prevent resource leaks. Additionally, it recommends replacing the use of any in the promise declaration with a proper type to align with the repository's TypeScript style guide.

Comment thread src/emulator/loggingEmulator.spec.ts
Comment thread src/emulator/loggingEmulator.spec.ts Outdated
Comment thread src/emulator/loggingEmulator.spec.ts Outdated
@joehan
joehan force-pushed the update-ws-dependency branch from 93fbaf4 to 0fb243b Compare July 27, 2026 19:59
### Description
Upgrades `ws` from `^7.5.10` to `^8.21.1` and `@types/ws` to `^8.18.1` to resolve security vulnerability CVE-2026-48779. Also regenerates the shrinkwrap file `npm-shrinkwrap.json` to lock the upgraded versions.
Verified that the breaking changes in `ws` version 8 do not break any functionality in `firebase-tools`:
- `WebSocketServer.prototype.close()` no longer closes existing connections automatically, but `LoggingEmulator` already manually terminates all active socket connections when stopped.
- Text messages and close reasons are no longer decoded to strings but passed as `Buffer`s; since the emulator does not listen to `'message'` events and the `'close'` listener does not read the close reason argument, this does not affect us.

### Scenarios Tested
- Added unit test `src/emulator/loggingEmulator.spec.ts` verifying that `LoggingEmulator` starts and broadcasts log messages correctly via WebSocket.
- Ran mocha test suite.

### Sample Commands
`npx mocha src/emulator/loggingEmulator.spec.ts`
@joehan
joehan force-pushed the update-ws-dependency branch from 0fb243b to 14382c1 Compare July 27, 2026 20:10
@joehan
joehan merged commit 5f81c5a into main Jul 27, 2026
52 of 53 checks passed
@joehan
joehan deleted the update-ws-dependency branch July 27, 2026 21:46
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.

3 participants