-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
devserver binds to network as well as localhost #2295
Comments
Could you clarify what kind of problems? People typically want to be able to test the app on mobile devices. cc @Timer |
We've always bound to the entire network (sorry!); we just never made this clear until 1.0.0.
Yes. Create an env file (
This will make the dev server only bind to localhost, which may be IPv6 or IPv4. You can be more specific and specify
@gaearon and I have talked and agree that this is a good default, which is why we make it as apparent as possible and show you a network address we're listening on. |
Binding to This is what the It appears we autodetected his public address instead of his lan address, which could be problematic. @talkingtab do you happen to be on linux? |
I am concerned that people will be allowing access to a product that is under development without understanding what they are doing. Maybe it is harmless, but I would suggest a better default is: |
yes I am. And yes that is my public network address |
@talkingtab a web application's source code is always public, so there's no sense in "protecting" it; when you use the In your case, it seems we grabbed your public ip address (most likely because you do not have a private address, do you?). We will need to address this security hole, because I do not believe that this is a sensible default. We should only permit private (same network) IP addresses. In the meantime, please create an |
I did add the .env and that works fine. I am not using a private address. And yes, I think it is a potential security hole. Thanks for the help, the fix and create-react-app. |
I've opened #2296 after this discussion. Thanks for the report! |
Should be fixed in |
Yes, it only binds to localhost on linux without a private network. Thanks! |
@gaearon Sorry to chime in on such an old issue but it looks like even binding to 10.x addresses is a security issue because on org Wi-Fi, the dev site will still be accessible to those on the network. I noticed in my dev console failed requests to malicious URLs, it looked like someone was scanning. I've set our repos to use |
Instead of opening a port on the localhost only, create-react-app now binds to the network as well. On a new instance when I run yarn start I get:
You can now view foo in the browser.
Local: http://localhost:3000/
On Your Network: http://xxx.138.90.222:3000/
I use ufw to close ports, but this change from previous versions seems like it could potentially cause problems.
The text was updated successfully, but these errors were encountered: