Service workers violate SOP for "no-cors" CSS
Categories
(Core :: DOM: Service Workers, defect)
Tracking
()
People
(Reporter: ehsan.akhgari, Unassigned)
References
(Blocks 1 open bug, )
Details
(Keywords: csectype-disclosure, sec-moderate)
Attachments
(2 files, 3 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Updated•9 years ago
|
Comment 1•9 years ago
|
||
Comment 3•9 years ago
|
||
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
Comment 8•9 years ago
|
||
Updated•9 years ago
|
Comment 9•9 years ago
|
||
Comment 10•9 years ago
|
||
Comment 11•9 years ago
|
||
Comment 12•9 years ago
|
||
Comment 13•9 years ago
|
||
Comment 14•9 years ago
|
||
Comment 15•9 years ago
|
||
Comment 16•9 years ago
|
||
Comment 17•9 years ago
|
||
Comment 18•9 years ago
|
||
Comment 19•9 years ago
|
||
Reporter | ||
Comment 20•9 years ago
|
||
Comment 21•9 years ago
|
||
Comment 22•9 years ago
|
||
Comment 23•9 years ago
|
||
Comment 24•9 years ago
|
||
Comment 26•9 years ago
|
||
Comment 27•9 years ago
|
||
Comment 28•9 years ago
|
||
Comment 29•9 years ago
|
||
Comment 31•9 years ago
|
||
Reporter | ||
Comment 33•9 years ago
|
||
Reporter | ||
Comment 36•9 years ago
|
||
Reporter | ||
Comment 37•9 years ago
|
||
Reporter | ||
Comment 38•9 years ago
|
||
Comment 40•9 years ago
|
||
Updated•9 years ago
|
Comment 41•9 years ago
|
||
Comment 42•9 years ago
|
||
Comment 43•9 years ago
|
||
Comment 44•9 years ago
|
||
Comment 46•9 years ago
|
||
Comment 47•9 years ago
|
||
Comment 48•9 years ago
|
||
Comment 49•9 years ago
|
||
Updated•9 years ago
|
Comment 51•9 years ago
|
||
Comment 52•9 years ago
|
||
Comment 53•9 years ago
|
||
Comment 54•9 years ago
|
||
Comment 55•9 years ago
|
||
Comment 56•9 years ago
|
||
Comment 57•9 years ago
|
||
Updated•9 years ago
|
Comment 58•9 years ago
|
||
Comment 59•8 years ago
|
||
Comment 60•8 years ago
|
||
Updated•8 years ago
|
Comment 62•8 years ago
|
||
Updated•8 years ago
|
Comment 63•8 years ago
|
||
Comment 64•8 years ago
|
||
Updated•6 years ago
|
Updated•4 years ago
|
Comment 65•4 years ago
|
||
Reopening as Safari has addressed this reportedly and standards-wise it's still an issue: https://github.com/w3c/ServiceWorker/issues/719#issuecomment-662900026.
Before we do anything here I think we should be super mindful about negative effects on ability to write offline web applications.
In particular, a website can already read large parts of the contents of unprotected CSS files. What this bug suggests is that we specifically protect values that contain URLs, while leaving the other parts of the CSS file just as exposed as before.
As a developer, it seems really risky to rely on the default SOP to protect the contents of CSS files given how much of the file contents that is readable across sites.
A better solution to me seems to be to enable solutions that enable protecting the entire contents of CSS files, images, scripts and other resources that can be embedded (and thus partially read) cross origin.
It's definitely true that leaving this bug unfixed could cause a security issue. I.e. where there's a CSS file that contains sensitive URLs but not other sensitive CSS values. But the same argument can be made about many changes to CSS syntax, such as with the introduction of variables. They too expanded the set of files which could theoretically now expose sensitive information to an attacker. Do we know of any such instances in the few years since Service Workers or CSS variables were shipped?
Additionally, some of the URLs that we're trying to protect here will still be exposed in the form of computed values on elements in the DOM.
In short, I think implementing the proposal here has significant cost for web developers, both in terms of reduced features, and in terms of a more complex security model. And the benefit seems mainly theoretical to me?
Separately, would Chrome and Safari be willing to fix [1]? If not would there actually be any security benefit for web developers?
Updated•4 years ago
|
Comment 68•4 years ago
|
||
Hi Anne, can you investigate further what should be our path forward here? Thank you!
Comment 69•4 years ago
|
||
I agree with Jonas that the situation isn't exactly great here and anyone putting secrets in CSS resources is well-advised to use Cross-Origin-Resource-Policy or equivalent.
Fixing this would help with:
- Inadvertently leaking secret URLs in
@import
and similar rules not directly exposed through computed styles. - Leaking information about the resources tied to those secret URLs through timing attacks on caches or fetching, or equivalent attacks. (At least, it seems this would be a lot harder if you do not get granular information through service workers.)
- Leaking secret URLs in rules that are guarded by selectors that are (close to) impossible to match.
- Moving the web platform to a state that's acceptable to everyone (as per comment 65 Safari is shipping this).
- Making it clear we take exceptions to the same-origin policy seriously.
So overall I continue to recommend we fix this in due course. Hope that helps.
It seems to me that without Chrome and Safari fixing the issue in comment 67 point 1 and 3 does not seem to apply. I.e. authors would still be leaking secrets in those URLs.
It seems like currently we're aligned with Chrome, but fixing this issue would align us with Safari. So it doesn't seem like fixing this issue would get us closer to consensus? Or has Google signaled that they are planning on fixing this issue?
As for point 5, has there been concern raised publicly that Mozilla is not taking SOP seriously? If anything, Mozilla has been pushing for CORS when other vendors have not, for example for video, fonts and sendBeacon().
This leaves point 2, which I honestly don't understand so I'll assume it is valid.
Comment 71•4 years ago
|
||
I don't see how comment 67 exposes URLs not exposed through computed styles. It seems this will be discussed as part of https://github.com/w3c/ServiceWorker/issues/1536 and I'll try to attend that (and other things mentioned there).
Updated•2 years ago
|
Description
•