-
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
Feature Policy shouldn't be overridable #357
Comments
Is the suggestion here that an explicit header policy of Presumably that logic would have to extend to any header-set policy, that if a header is present at all, then any origins not mentioned in the header can not have the feature delegated to them. |
Right :) |
One approach we might take with this would be to change the way that the header and allow attributes work -- to say that in cross-origin cases, both header and allow attribute have to agree in order for any feature to be delegated. For example, if we could choose to make the header default '*' for a feature, then the allow attribute could be used to delegate to any domain, but it wouldn't happen automatically. (This would be the same behaviour as exists today, if the header is not present). A site could choose to restrict that via header to just That would mean that you can't just use the header to set the defaults, and expect automatic delegation without the attribute, so I'd want to investigate how compatible that is with existing usage. I suspect that it is compatible, that current usage falls into one of three categories, that are unchanged by this:
Cases which would see changes:
There may be other cases I'm not thinking of; changing that behaviour for existing sites may be trickier than I'm thinking :)
|
An outsider here (aka someone not involved with Mozilla/Google/Microsoft/W3C). This proposed behavior is more intuitive (more similar to CSP's |
Another consideration for backwards compatibility is that sites often include third-party scripts in the top-level document (e.g. ads, social widgets, comment frameworks, etc.), for additional functionality. Sites may or may not have the expectation that the third-parties can add/modify frames in the document. Even if the sites expect frames to modified, the sites might not know the origins of such frames in advance. The end result seems hard to distinguish from malicious markup injection. In theory, this doesn't seem to introduce any new problems, since CSP already has |
FWIW, I think this change makes a lot of sense. (Another interesting feature might be blocking everything unless it's safelisted.) |
That sounds like the long-standing #208, which hopefully we can resolve now, with most of the potentially problematic features moving to Document Policy. |
I meant #189 actually, as it's the more flexible version of the same concept. |
Yeah, you'd only disable them for yourself as third parties couldn't get them anyway so that should work. |
In current spec, setting
feature-policy: geolocation 'self'
in top-frame wouldn't restrict cross-origin iframe to request access to Geo location (e.g.<iframe allow="geolocation" src="https://cross-origin.tld"></iframe>
). This has to change, in order to provide some mechanism to avoid leaking permission to cross-origin iframe (especially in the browser that supports Permission Delegation).The text was updated successfully, but these errors were encountered: