Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to latest version of socket.io due to security vulnerability #1936

Merged
merged 3 commits into from Mar 4, 2022
Merged

Upgrade to latest version of socket.io due to security vulnerability #1936

merged 3 commits into from Mar 4, 2022

Conversation

lachieh
Copy link
Contributor

@lachieh lachieh commented Feb 24, 2022

There are 4 main things that had to change to support the upgrade to the latest version of socket.io

  1. Socket.io@3+ uses TypeScript@4: This was a simple upgrade since there's not a lot that uses TS in this project.
  2. Removal of io.set(): This was deprecated in v2 and removed in v3. It was being used to set the heartbeat timeout, but that setting was also removed in v3 because engine.io reversed the mechanism.
  3. Adjustment of CORS configuration: CORS changed to being off by default, which required switching the callback for the configuration into the new format
  4. Fix property collision: socket.io@3 renamed the connected property of the server to sockets, which is the name chosen internally in browserSync to attach the namespaced socket back to the server instance. This fix probably needs further refactoring, but for the browserSync use case, it works fine.

Fixes #1847
Fixes #1850
Fixes #1892
Fixes #1925
Fixes #1926
Fixes #1933

- switch to ts-loader over deprecated `awesome-typescript-loader`
- update invalid window.reload implementations
@abbyblachman
Copy link

is there any update on when this will be fixed?

@lachieh
Copy link
Contributor Author

lachieh commented Mar 3, 2022

It's fixed, I'm just waiting on someone from the team to review/approve/merge

@shakyShane shakyShane merged commit 6e8d2b2 into BrowserSync:master Mar 4, 2022
@shakyShane
Copy link
Contributor

Thank you so much @lachieh, this is great :)

@shakyShane
Copy link
Contributor

@lachieh this actually breaks connections between server/clients - it's 100% my issue here for not enabling the integration tests in CI, which I'm resolving now

@lachieh
Copy link
Contributor Author

lachieh commented Mar 4, 2022

@shakyShane thanks for merging! Is there anything I can help with?

@shakyShane
Copy link
Contributor

@lachieh sorry for the delay - this is fixed in 2.27.8

I went ahead and bumped socket.io-client to latest also.

@lachieh
Copy link
Contributor Author

lachieh commented Mar 13, 2022

Awesome, thanks so much for the work!

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