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

Avoid adding a new directive to CSP #88

Open
letitz opened this issue Nov 7, 2022 · 4 comments
Open

Avoid adding a new directive to CSP #88

letitz opened this issue Nov 7, 2022 · 4 comments

Comments

@letitz
Copy link
Collaborator

letitz commented Nov 7, 2022

@mikewest tells me that he wished not to add a new directive to CSP in the form of treat-as-public-address. crbug.com/1000226 has been languishing in obscurity for Chromium.

Since this is a useful primitive for tests in particular, I'd like to keep it in some form. In fact, I believe we can solve two issues at once by spelling this as a sandbox flag.

If we define a new sandbox flag that grants access to the private network (provided PNA checks succeed), then we can also solve #26.

For iframes:

sandbox="allow-private-network"

For top-level documents, CSP would still be used to deliver the flag, but we would avoid adding a new directive.

@letitz
Copy link
Collaborator Author

letitz commented Nov 7, 2022

It would be best to determine the compatibility impact of such a change. Do many sandboxed iframes need access to the private network? They would lose it as part of this change unless they added the new flag.

@mikewest
Copy link
Member

mikewest commented Nov 8, 2022

This model seems pretty reasonable to me if it's borne out by usage numbers. Independent from tests, I think it's good to give pages a way to drop their network-positional privilege. I'd simply like to do so without further muddying the waters around what CSP does.

@annevk
Copy link

annevk commented Nov 8, 2022

Well, CSP does do sandboxing. 😊

@mikewest
Copy link
Member

mikewest commented Nov 8, 2022

Yup. And if sandboxing grows some new functionality, CSP should pass it through so we can tell a consistent story about top-level sandboxing! That said, I don't think we'd put sandbox into CSP if we were talking about it today, and I'd like to avoid expanding CSP's remit in itself. Adding a new sandbox flag with purely negative effect seems pretty in-line with the rest of sandbox, and allows us to explain the behavior in a way that feels fine to me.

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

3 participants