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

[emrun] Don't listen to 0.0.0.0 by default (#22077) #22645

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kolAflash
Copy link
Contributor

A developer might start emrun without thinking about the --hostname setting. So he might expose sensible data on the webserver to the LAN or to the Internet. It might even happen, that a vulnerable Emsdk version becomes publicly reachable.

Instead use localhost (127.0.0.1) by default, which is usually sufficient for development.

@kolAflash
Copy link
Contributor Author

bug #22077

…core#22077)

A developer might start emrun without thinking about the --hostname
setting. So he might expose sensible data on the webserver to the LAN or
to the Internet. It might even happen, that a vulnerable Emsdk version
becomes publicly reachable.

Instead use localhost (127.0.0.1) by default, which is usually
sufficient for development.
@sbc100 sbc100 changed the title Don't listen to 0.0.0.0 by default for security reasons. (#22077) [emrun] Don't listen to 0.0.0.0 by default (#22077) Sep 27, 2024
@sbc100
Copy link
Collaborator

sbc100 commented Sep 27, 2024

I normally do all my work over ssh and then point my browser at the IP of the my server.. so I guess I will always be adding --hostname 0.0.0.0. I wonder if there is some way we can make it even more obvious to folks how to opt into this if they (like me) need to.

@juj
Copy link
Collaborator

juj commented Sep 27, 2024

so I guess I will always be adding --hostname 0.0.0.0.

Hmm hmm.. yeah, I can see that this can be tedious.

Although emrun already has the default that it attempts to launch a browser, so you've been passing the --no_browser flag as well I presume?

I find it tedious to need to write that --no_browser flag all the time, so I ended up creating a serve.bat in my own local user bin/ folder, which runs emrun --no_browser --port %*, which I then run with serve 8000 to launch a web page. Maybe something like that might make sense?

If we defaulted to 0.0.0.0 and while doing so, print a warning that this will be accessible to all users, and then ask developers to opt to --hostname=127.0.0.1, then they would find it tedious.

@kolAflash
Copy link
Contributor Author

If you have any ideas for fixing the failed tests or making the discussed suggestions, feel free to amend a patch.

@sbc100
Copy link
Collaborator

sbc100 commented Sep 30, 2024

so I guess I will always be adding --hostname 0.0.0.0.

Hmm hmm.. yeah, I can see that this can be tedious.

Although emrun already has the default that it attempts to launch a browser, so you've been passing the --no_browser flag as well I presume?

I find it tedious to need to write that --no_browser flag all the time, so I ended up creating a serve.bat in my own local user bin/ folder, which runs emrun --no_browser --port %*, which I then run with serve 8000 to launch a web page. Maybe something like that might make sense?

If we defaulted to 0.0.0.0 and while doing so, print a warning that this will be accessible to all users, and then ask developers to opt to --hostname=127.0.0.1, then they would find it tedious.

Yes, I run with --no-browser already. Its easy enough for me to add --hostname=0.0.0.0.

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