-
Notifications
You must be signed in to change notification settings - Fork 36
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
Same-origin policy & observing no-cors fetches #27
Comments
Has a test case to validate this hole in Chrome/Firefox been created? I'd like to re-use it to validate Microsoft browsers. |
|
Er, to clarify, that's not the corresponding WebKit bug for this stuff. It's the corresponding WebKit bug to this paper, https://www.linshunghuang.com/papers/css.pdf, which is an example of cross-origin CSS info leakage being a concrete problem in the past. ETA: Full context for my quoted comment:
|
Microsoft agrees this should be explicitly called out in the spec and blocked. |
Looking at the plumbing, I think step 3 in processing is where we need to restrict this behavior:
That said, I'm not sure about the correct language to carve out ~"fetches initiated by Documents fetched with no-cors flag". @annevk any suggestions on this one? |
The way this should really work is through the fetch registry I think. Resource timing would hook into that. Then we need CSS to be defined in terms of Fetch and set some kind of "opaque request flag" for no-CORS CSS subresources. And the fetch registry has a view that doesn't expose opaque requests which all APIs would be required to use. Until that time, calling out no-CORS CSS somehow and saying we're waiting for everything to be written in terms of Fetch seems like the best monkey patch you can do, but I'm open to suggestions. |
Ok, for time being, how about..
|
Nit: Unless we've already lost that game (but skimming around, it doesn't seem to be the case), we shouldn't call anything a "CSS document". A document is a very particular kind of object with a whole lot of semantics attached to it. CSS does not create those things. |
@davidben I'm not clear on what you mean with "CSS does not create those things".. Are you suggesting I strike the "document" part and simply refer to it as "fetched by cross-origin CSS resources fetched with.."? |
Yes, use "cross-origin CSS resource" or "cross-origin stylesheets". |
I would also appreciate a note about refactoring that in terms of Fetch down the line, so that those implementing might do the right thing. |
Yeah looks good. Though you might want to point to https://fetch.spec.whatwg.org/#concept-fetch instead of HTML, since the HTML definition doesn't handle a number of things, and doesn't call it "no-cors". |
Good call, fixed: f7ce98a |
Was a test for this ever added to web-platform-tests? |
https://wpt.fyi/results/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html according to https://chromium-review.googlesource.com/c/chromium/src/+/3781346 and the CL will fix the behavior on Chrome. |
The text was updated successfully, but these errors were encountered: