note about data: URLs always returning opaque responses seems not quite right #35

Closed
wanderview opened this Issue May 12, 2016 · 7 comments

4 participants

@wanderview

Currently section 3.3.2 has this note:

Since the response type for data URLs will always be “opaque” for script and link elements, such URLs are never eligible for integrity checks. Blob URLs on the other hand are usually considered same-origin and therefore are eligible for integrity checks.

I don't think this is quite accurate. I can't find a spec that says for<link rel="stylesheet"> data URLs should not inherit the origin. And in gecko we actually do inherit the origin in this case and treat them as same-origin.

@fmarier
Member
fmarier commented May 17, 2016

I added that note in w3c/webappsec#487 based on a discussion on the webappsec list and a discussion with @annevk.

What kind of change would you propose?

@wanderview

Well, there is no browser agreement about whether to set the "same-origin data-URL flag" for stylesheet loads or not. Firefox essentially set it. I believe @bzbarsky told me Edge essentially sets it. It appears chrome does not set it.

So I think the note should not make this sweeping statement about data URI stylesheets. And it seems to me SRI should work on them if the browser sets the "same-origin data-URL flag" when loading stylesheets.

@bzbarsky
bzbarsky commented May 17, 2016 edited

It's worse than no browser agreement. Not setting that flag but also not shipping some of the bugs Chrome ships in terms of cross-origin stylesheet security checks is probably not web compatible.

In other words, the note is based on bogus spec text, and will likely become false once the HTML spec is fixed.

@fmarier
Member
fmarier commented May 17, 2016

So in concrete terms, would you revise the note or remove the note entirely?

Is the algorithm itself flawed?

@devd
Collaborator
devd commented May 17, 2016

removing the note sounds good to me

@fmarier
Member
fmarier commented May 18, 2016

I removed the note in #38.

@fmarier fmarier closed this in ef5f92b May 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment