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

Reverse HTTP for CSRF/XSS-proofing of localhost webservers #1685

Open
SoniEx2 opened this issue Jul 13, 2023 · 5 comments
Open

Reverse HTTP for CSRF/XSS-proofing of localhost webservers #1685

SoniEx2 opened this issue Jul 13, 2023 · 5 comments

Comments

@SoniEx2
Copy link

SoniEx2 commented Jul 13, 2023

Sometimes you want a localhost webserver. Instead of exposing it to anything that may run in a browser, and thus be forced to worry about CSRF, XSS, and all that good stuff, what if you just... didn't?

What if you could have your localhost webserver and not have to do all of that?

The only reason those are a concern is because arbitrary websites can connect to the localhost webserver. The obvious solution is to prevent that. The actual approach to prevent that is not as obvious, however, but it'd probably be called "Reverse HTTP" of some sort.

@annevk
Copy link
Member

annevk commented Jul 14, 2023

https://wicg.github.io/local-network-access/ attempts to solve that. It'll eventually be mostly integrated into Fetch.

@SoniEx2
Copy link
Author

SoniEx2 commented Jul 14, 2023

That's neat, but considering the CSP changes we feel like maybe something with an uniquely allocated, opaque origin would be more appropriate?

Like, that's the real benefit of reverse HTTP: you prevent other connections altogether. And localhost webservers don't need to be able to fetch eachother - they can use standard system-level IPC instead.

(But reverse HTTP does only cover localhost...)

@annevk
Copy link
Member

annevk commented Jul 14, 2023

I'm not sure what CSP has to do with it?

@SoniEx2
Copy link
Author

SoniEx2 commented Jul 14, 2023

this prevents further connections without preflight: https://wicg.github.io/private-network-access/#csp

but it doesn't make a fully isolated sandbox. you can still accept requests from public websites.

(we do appreciate that it blocks navigation by default tho. that's really nice to see.)

@avioligo

This comment was marked as spam.

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

No branches or pull requests

3 participants