-
Notifications
You must be signed in to change notification settings - Fork 164
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
Define the [CrossOriginIsolated]
extended attribute.
#883
Conversation
Hey folks! This can't actually land as-is, given that "cross-origin isolated" is still floating around in a set of PRs against HTML, but I'm hopeful that y'all can give me some direction about the mechanics of defining the This patch does the simplest thing possible, by copy/pasting WDYT about the approach? Would it be worth going back to making "exposure attribute" a generic concept? Or is a bit of duplication better for clarity? |
My take is that at least the "available only in cross-origin isolated contexts" / "available only in secure contexts" bits should be deduped into a single parametrized algorithm. (I noticed one [SecureContext] was not changed to [CrossOriginIsolated] in the former ^_^.) The duplication for the rest seems more clarity-enhancing, since it is kind of general "extended attribute boilerplate" that you expect to see for all of them. That algorithm could live after the definition of "exposed", perhaps? Another nit: extended attributes are alphabetized :). |
I miss a statement that SecureContext and CrossOriginIsolated are mutually exclusive. I think like elsewhere, we should not allow duplicate requirements. |
Hrm. I noted my preference for the opposite in #875 (comment). :) But, since I kinda want to throw |
I think it should be an error. |
I can write something up that makes |
SecureContext has some of those checks specific to only SecureContext, e.g., "The [SecureContext] extended attribute must not be specified both on an interface member and its interface or partial interface." I guess you could make "The [SecureContext] extended attribute must not be specified on an interface member if its interface or partial interface has the [CrossOriginIsolated] extended attribute." from that. This is not my area of expertise though. @saschanaz might have better ideas. |
This comment has been minimized.
This comment has been minimized.
I think we'd have one rule for
This is more or less the spelling of the proposal in https://github.com/mikewest/securer-contexts#a-proposal ( |
That's fair. I think the inversion is clearer as distinct attributes, but it certainly works as That said, let's go back to your suggestion that:
This works for secure transport and cross-origin isolation, as the latter implies the former. Injection mitigation is currently orthogonal, evaluating whether a CSP is present, not whether the context is securely delivered. Perhaps we'd say that any contextual exposure would require secure contexts? |
@annevk: Any objections to something like |
I lean to this, but it probably should only allow one argument, given that there is no use case to have multiple arguments so far? And maybe we could also consider having |
Another point is that do we allow a interface with |
As hand-waved at above, I do think we'll end up with multiple arguments. I have concrete plans for at least
I'd be a bit more aggressive with the naming;
Yes. We would want to support this. |
So we want them to be not mutually exclusive? |
I see, so if two conditions have non-overlapping requirements, then ( |
I think AND is the only combination that makes sense. |
I want the following to be legal so that we can restrict new things added to old interfaces (I'm thinking of the
@annevk does not want the following to be legal:
So, (Sorry this is confusing.) |
This looks pretty close to landing, and https://github.com/WICG/performance-measure-memory/ would like to use it. I'm happy to carry this over the finish line, but can someone confirm for me what's left to do? My read is:
|
I would love for you to pick this up, @domenic. I have not had time to work out the right way to address your second bullet above, which seems like the only complicated bit left. If simple prose assertions make other folks on the thread happy, I'm certainly fine with them. :) |
WebIDL currently defines a `[SecureContext]` extended attribute that governs whether or not a given construct is exposed within a given context. This patch defines a similar `[CrossOriginIsolated]` attribute to govern exposure based on cross-origin isolation. This supports the broader Securer Contexts proposal (https://github.com/mikewest/securer-contexts), which aims to guide spec authors to combat threats we've started paying more attention to over the last few years. Closes whatwg#875.
4a46b22
to
3620348
Compare
OK, I think this is ready then. Instead of agent cluster's cross-origin isolated, I went with environment settings object's cross-origin isolated capability, since we want the exposure here to be controlled by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks this looks good. I rather not call things PowerfulFeature as that tends to create confusion.
Are the 4 newlines before a <h4>
intended?
Co-authored-by: Anne van Kesteren <[email protected]>
WebIDL currently defines a
[SecureContext]
extended attribute thatgoverns whether or not a given construct is exposed within a given
context. This patch defines a similar
[CrossOriginIsolated]
attributeto govern exposure based on cross-origin isolation.
This supports the broader Securer Contexts proposal
(https://github.com/mikewest/securer-contexts), which aims to guide
spec authors to combat threats we've started paying more attention to
over the last few years.
Closes #875.
Preview | Diff