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: listen on localhost only by default? #8

Open
fvsch opened this issue Aug 13, 2024 · 1 comment
Open

Security: listen on localhost only by default? #8

fvsch opened this issue Aug 13, 2024 · 1 comment

Comments

@fvsch
Copy link
Owner

fvsch commented Aug 13, 2024

Currently, running servitsy without a custom --host argument will listen on :: (similar to 0.0.0.0), so that the server is reachable from other devices connected to the same local network.

This can be useful for development, when one wants to serve a folder of static files as a website that can be tested on a different device on the same network (e.g. a smartphone connected to the same wifi router).

But there are potential downsides like the “0.0.0.0 Day” family of vulnerabilities. It shouldn’t affect this package since it’s mostly about local servers that can write to disk or change some configuration or state from unauthenticated PUT or POST requests. Still, it might be better to err on the safe side and listen to localhost by default.

@fvsch
Copy link
Owner Author

fvsch commented Aug 13, 2024

An interesting option might be to implement an authorization token like Jupyter notebooks do:
https://jupyter-server.readthedocs.io/en/stable/operators/security.html

Maybe only for requests on hosts that are not localhost by default?

@fvsch fvsch changed the title Should it listen on localhost only by default? Security: listen on localhost only by default? Aug 13, 2024
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

No branches or pull requests

1 participant