-
Notifications
You must be signed in to change notification settings - Fork 155
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
Architecture discussion: Sandbox policies #300
Comments
One issue with |
Also, any new header here should probably be designed to fit within the Structured Headers model. I expect that a simple list of tokens would be sufficient:
|
At a high level, I wonder if this new policy type should either merge with, be included in, or replace parts of the CSP spec (I am in part repeating part of what clelland@ mentions in the first comment).
|
I would not mind merging with CSP or CSP deferring to this new header for a superset of its functionality. CSPEE does make merging somewhat attractive I suppose. Part of the motivation behind the sandboxing features (before part of Feature Policy) that @clelland mentioned was not opting into all the things |
As mentioned in https://github.com/w3c/webappsec-feature-policy/issues/282#issuecomment-486267212, there's interest in splitting different types of policies out into different pieces of FP. I'm going to try to define the 'sandbox policies' piece here, and leave the other two to their own issues. This issue can become the central bikeshed for that behaviour.
The key difference between sandbox policies and the other two pieces is that, while these can be applied by a document to child frames, they require an explicit opt-in acknowledgement by the document in that frame, or else the child document will not load. (This negotiation would not be required by documents with about:blank, data: or blob: urls)
Rough sketch:
Unlike document policies, but very much like iframe sandboxing, these policies are required to be enforced in child frames.
Sandbox features are all enabled by default in all browsing contexts, until disallowed by policy.
Resources can sandbox themselves with a response header (bikeshed:
Sandbox-Policy
) containing a list of features which will be disallowed. They can also further restrict any iframes with an HTML attribute (<iframe disallow
>?)As an opt-in negotiation, the browser would send a request header (bikeshed:
Require-Sandbox-Policy
) with a list of features which will be disabled. The response must be returned with a response header which includes at least those features. Without that, the document will not be loaded. (It should fail with the same mechanism used by Embedded CSP)These policy declarations would not require allowlists or parameters; the policy would be applied to the document received with the response header.
Question: Does this design allow for existing sandbox features to be used without the opt-in negotiation?
The text was updated successfully, but these errors were encountered: