-
Notifications
You must be signed in to change notification settings - Fork 8
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
Proposal: Define new feature types #19
Comments
@annevk @bzbarsky @jyasskin @martinthomson @ojanvafai FYI, any comments or bikeshed discussions welcome :) |
I think that these are the things you have in mind. I see the "permissions" group as being most urgent for Mozilla, with varying degrees of value for the others. The important point here is that we see this as being guidance not just on how to deal with features generally, but also on the technical manifestation of the controls. That is, there might be a different implementation for each of the categories, with different means of controlling the feature. Categorizing in this way should make it easier to make appropriate choices about what mechanisms are used to support each. For example, with permissions, the most important thing for us is providing a way for a page to set the inherited permissions for sub-frames. The complicated machinery in this proposal with a rich policy language and HTTP header field is not necessary to support that. What are your plans with CSP here? |
I'm slightly uncomfortable with making the categorical distinctions outlined here. If the policy mechanism is different for some policies vs others, on an abstract point such as whether the policy decision permeates iframes, that makes the whole thing quite difficult to reason about, unless we were to split feature policy into multiple separate standards. In my mind the best practices / antipatterns flags are not just for site owners' benefit - as a developer I might reasonably want to enforce no document-write API for third party subframes, for example, and get reports when subframes violate those policies. It's the best practices / deprecations flags that are most exciting about Feature policy for me, and I'm keen not to see these get too complicated, otherwise I think we risk substantially reducing adoption. In relation to @martinthomson's point, it's my understanding that the vast majority of foreign origin subframes are created by third party scripts that execute in the root document. Therefore, is solving the problem of inheritance of permissions for subframes really possible without setting policy on the root document? |
I think it actually makes sense to indeed split these into different features as you suggest @triblondon. I'm not sure about 2 and 4, but for permissions and sandboxing I have some thoughts:
Permission capabilities are useful to allow the first-party to enable a third-party subframe to ask something from the user on behalf of the first-party. Sandboxing capabilities are useful to allow a first-party to impose restrictions on a third-party the third-party cannot get out of (i.e., not even via an |
Agree on the URL bar thing. If it has a visible domain, it should be able to make its own way in the world of policy. Disagree on the distinction - If we can model all policies in the same way, we should, and the standard will be more powerful for it. |
You cannot have both given the status quo on sandboxing. |
@annevk, What you're saying about permissions makes some sense -- maybe they are categorically different from powerful features, since the point is all about delegating the ability to ask the user for permission, rather than just the ability to use the feature. In general, I don't think we want to allow popups to be a way to circumvent policies, but in this case, it seems right -- at least if the URL bar is visible. I'll see if I can get some security UI folks to chime in.
The distinction between things which are normally allowed (sandbox, antipatterns) and normally disallowed (permissions in cross-origin frames) is a useful one. |
I think that’s because a permission is more than the absence of a restriction to be circumvented. It’s a delegation of user trust not otherwise available through escape to some baseline. I think our reverse framing of restrictions as allowances—though I appreciate the benefits of this—helps blur the distinction between restrictions (on baseline privileges) vs. elevated origin-tied privileges not normally extended across top-level origins, e.g. to popups. Whether an API that leverages this overlap is a good one or a bad one, I think is the debate. I'm open to mentally taxing implementers, as long as the leaky abstraction does not lead to user error. |
@clelland and I discussed this further offline, taking into account some new ideas at Google and Mozilla, and the rough plan is to split FP into 3 pieces:
Note that Document and Full sandboxing will not allow for per-origin control over features. Document sandboxing applies to the current Document only and Full sandboxing applies to all origins that end up in a sandboxed browsing context. |
This seems like a reasonable idea. I don't feel that excited about it, mainly because it's a lot of complexity and wiring for developers to adopt, but also more practically because it seems to eliminate a couple of useful use cases, such as imposing deprecated feature restrictions on third parties. For example is setting |
Some might be both. Ultimately it should be the same amount of complexity or less, but some of the complexity is more directly visible this way and not hidden behind a boolean implicitly associated with a feature policy string. |
I've proposed a slightly different version of this, explainer-style, in w3c/webappsec-permissions-policy#328; basically covering document sandboxing and full sandboxing, for a common set of features. Developers would have the ability to specify whether they wanted to restrict just themselves, just certain subframes, or both. If we move that direction, then the existing spec would cover the feature delegation case, for permissions and other features which are enabled for top-level documents, and need to be delegated to third parties. Based on discussions with folks, and on the feature survey in w3c/webappsec-permissions-policy#296, I'm convinced that those features are a different kind than the document-configuration or sandboxing-style features. |
Closed with the introduction of Document Policy to handle the non-permissiony, non-powerful-feature model. Document Policy handles the two sandboxing mechanisms mentioned here, the performance-best-practices, and probably the hopeful deprecations. |
Following up on the discussion in w3c/webappsec-permissions-policy#252, I think it may make sense to identify the different types of features in the web platform, and define different strategies for how they should be handled as policy-controlled features.
The current mechanism for declaring these strategies is the default allowlist, which isn't actually an allowlist, but one of three special values. These values define the default availability and the inheritance strategy for the features which use them; we should be able to define new strategies, while still keeping within the spirit of the original design.
In offline discussions, we've identified at least these types of features:
'self'
)*
)*
)There may be more, but hopefully not too many.
I think that we can replace the existing "default allowlist" concept with something more like an "inheritance strategy". We can remove the unused
'none'
value and define an initial set of four strategies:Permissions and Powerful Features
Performance Best Practices
Sandbox features (#74)
Hopeful deprecations (bikeshedding for a better name needed)
Feature-Policy
headerallow
attribute, but the loaded document must have aFeature Policy
header which accepts that restriction, or else a network error will be triggered.The text was updated successfully, but these errors were encountered: