fix: bump ws dependency to ^8.21.1 (CVE-2026-48779) - #10854
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
joehan
force-pushed
the
update-ws-dependency
branch
from
July 27, 2026 19:59
93fbaf4 to
0fb243b
Compare
### 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
force-pushed
the
update-ws-dependency
branch
from
July 27, 2026 20:10
0fb243b to
14382c1
Compare
inlined
approved these changes
Jul 27, 2026
This was referenced Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Taking over #10817
Upgrades
wsfrom^7.5.10to^8.21.1and@types/wsto^8.18.1to resolve security vulnerability CVE-2026-48779. Also regenerates the shrinkwrap filenpm-shrinkwrap.jsonto lock the upgraded versions.Verified that the breaking changes in
wsversion 8 do not break any functionality infirebase-tools:WebSocketServer.prototype.close()no longer closes existing connections automatically, butLoggingEmulatoralready manually terminates all active socket connections when stopped.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
src/emulator/loggingEmulator.spec.tsverifying thatLoggingEmulatorstarts and broadcasts log messages correctly via WebSocket.Sample Commands
npx mocha src/emulator/loggingEmulator.spec.ts