-
Notifications
You must be signed in to change notification settings - Fork 148
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
Referrer and cross-origin CSS #413
Comments
Without thinking about it too hard, setting the |
That doesn't solve the problem for cross-origin CSS, "no-cors" or "cors". |
@jeisinger ^^ |
what about letting the service worker not change the referrer at all? requests created from the service worker get the URL the service worker was loaded from as referrer with whatever referrer policy the CSP set. if a service worker gets a fetch object from somewhere else, the referrer of that fetch object applies instead. |
The tricky thing with that is that while you can reuse E.g. the referrer points to some CORS CSS resource, but the method used is |
i guess when we update the target url, we should update the referrer according to the referrer policy, that's all, no? |
Here's the scenario I'm worried about: a CORS CSS resources lives at |
Why not only copy the referrer if the SW "executes" the Request object that it received in the onfetch event? And otherwise require that the referrer is of the origin of the SW. I.e. if sw does |
Yeah, I think that's what we should do. And if you pass a dictionary as in |
That still leaves the question of how Fetch' referrer feature should work. Only allow policy values (as with the proposed |
Given that Maybe it's as simple as making the But if the SW creates its own Request, then we'd use the default policy of the SW. Either way, if the SW explicitly sets a referrer, then that should be allowed as long as the referrer url is same-origin with the SW. Only pity is that there's nothing like |
i'd rather not allow same origin urls: we'd (again) run into problems like some.site/~user1 vs some.site/~user2 etc.. |
That's already possible. A page on some.site/~user1 can open some.site/~user2 in an |
fair enough. it collides, however, with the per-page suborigin thing the WebAppSec group is working on as well, where ~user2 could restrict itself to a different suborigin that ~user1 no longer can access. Would we in that case query ~user2 somehow before we allow the sw on ~user1 to set its referrer to ~user2? |
How does that proposal deal with |
that is an excellent question |
So yeah, with |
This is now fixed in Fetch with whatwg/fetch@3a21ed3. Outstanding work for Referrer Policy is summarized in #409 (comment). |
This is somewhat related to #409 and depends on the outcome of w3c/ServiceWorker#719.
The question is mostly how the service worker can set the correct referrer for these kind of resources if it were only allowed to set same-origin URLs.
(I'm assuming setting referrer to any URL would not fly.)
The text was updated successfully, but these errors were encountered: