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

[Security] Update ws dependency #23520

Closed
wants to merge 3 commits into from
Closed

Conversation

ericlewis
Copy link
Contributor

@ericlewis ericlewis commented Feb 18, 2019

Summary

Our ws dependency is super outdated, and is insecure. It is used for the websocket example code in RNTester. This PR updates the dependency, and removes undefined console.logs.

Changelog

[General] [Security] - Updates ws dependency to 6.4.1

Test Plan

run RNTester & ensure works, check integration test too.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 18, 2019
@pull-bot
Copy link

pull-bot commented Feb 18, 2019

Warnings
⚠️ 🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.

Generated by 🚫 dangerJS against 058288e

@ericlewis
Copy link
Contributor Author

And more specifically addresses this comment: react-native-community/discussions-and-proposals#64 (comment)

@ericlewis ericlewis changed the title Update ws dependency [Security] Update ws dependency Feb 18, 2019
@radeno
Copy link
Contributor

radeno commented Feb 18, 2019

CLI, Metro and Detox depends on ^1.1.x.

They should be also updated. Doesn't they?
Multiple different versions makes bundle bloated, because every package have own dependencies versions bundled within.

When will be WS updated for RN it should be updated for CLI and Metro also. But Detox is little bit complicated because there was initiation for update, but it breaks theirs Jenkins CI.

@ericlewis
Copy link
Contributor Author

I honestly think that we should not even have ws as a dependency in this repo for the only purpose of serving up a demo in RNTester, seems a little silly. Could we perhaps just remove instead?

@ericlewis
Copy link
Contributor Author

I would also be happy to find another way to deal with the websockets, it’s a very small surface area.

@radeno
Copy link
Contributor

radeno commented Feb 19, 2019

@ericlewis i agree with you. I also think if it is not possible it should be moved into devDependencies because it is not necessary in production. Or is it required for CI with --production flag?

Copy link
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

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

Ah this is great, thanks for the change. Just for context, the reason it was probably in dependencies is because react-native depends on it through Metro, which uses websockets for HMR. This means that we will definitely need to upgrade Metro to use the latest version of ws if we want to get rid of the outdated one. Is this something you could do in a separate PR? Feel free to tag me if you do and I'll land it :)

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@cpojer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Feb 20, 2019
@facebook-github-bot
Copy link
Contributor

I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification.

@facebook-github-bot facebook-github-bot added Import Failed and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 20, 2019
@react-native-bot
Copy link
Collaborator

@ericlewis merged commit a9c8e2c into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 21, 2019
@react-native-bot react-native-bot added the Merged This PR has been merged. label Feb 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants