-
Notifications
You must be signed in to change notification settings - Fork 0
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
Escalation to code execution #16
Comments
In the case of the meta tag, would the CSP rules still apply to the script? If that were the case it would seem to rule out the remaining con? |
Originally, I said the same thing before #15 got merged (exactly here), but then @yoavweiss said (rightfully so) how this wasn't a good answer, given how many consumers of the API could very likely be not very well informed about the importance of a strong CSP configuration. |
Perhaps the RIC script it self could be script-src on the fallback but have a more refined CSP policy like ric-src that could be used to provide more granular control via the CSP? |
The biggest issue with non-header alternatives is in how to make sure it applies before any script in the current document. For example a script tag could appear before the meta tag. And for service workers, they are designed to not impede the first load of a page that previously didn't have a service worker installed. |
Perhaps, but feels like things are getting messier going down this path.. Would prefer to come up with something that introduces less things to be aware of |
Why is it important though? From my perspective, being able to decide when RIC kicks in, and to allow scripts to run before it, is a feature rather than a bug. Obviously you should make sure it's dictated before other scripts, but maybe you prefer not to for whatever use case relevant to you, nothing wrong with that. |
The RIC script will apply to other realms as the first script running. If the same RIC script also applies to the main realm, it may run after these other scripts have run. I suppose there is a bigger question of in the common use case, would the main page RIC script would be the same as for dependent realms. |
Being an issue worth pondering, we dived into this concern in the last Endo meeting and came back with some excellent conclusions of what restrictions we must apply so that a header remains the proper way to go with:
These should be formalized and integrated into the explainer. |
while #26 address this issue, we (@yoavweiss) decided to consult the Security WG on our conclusions, so this issue remains open for wno |
Generally, I think the approach of requiring same-origin JS URLs is reasonable. The one additional rule I'd suggest there is that we should also block redirects, so as to ensure that open redirects don't lead to bypasses. I will say that from my perspective as someone who would be interested in using this feature, the same-origin restriction will make usage tricky. Ideally, we'd be doing something like setting One possible idea would be doing something along the lines of a site-wide well-known file. For example, |
@ddworken, I'm still thinking about the rest of your (great) points, I want some time to ponder those. One quick question that does come to mind though, can you elaborate on your open redirects concern? Do you mean, disallow the JavaScript code in the RIC script to perform a redirection? Why do you reckon we should block this specifically, and how is this different from any other regular script having the ability to perform such redirection? Especially under the (current) assumption that both such scripts originate from the same origin as the app. |
Yeah! So my concern is specifically about ensuring that
I think this is probably a pretty small and easily addressable concern. :) |
The escalation-to-code-execution part of the explainer requires us to address it and think about it:
More thoughts:
I think I'm leaning towards option#2 (meta tag) which is a great sweet spot in the middle between a header and a JS API, because:
That being said, when comparing option#3 to the serviceWorker API, it makes a lot of sense, as the 2 are much alike in terms of power and SOP sensitivity
All in all, a lot to ponder, but what's becoming more clear to me is that option#1 (current proposal's state) is probably the worst one...
The text was updated successfully, but these errors were encountered: