-
Notifications
You must be signed in to change notification settings - Fork 93
Use more specific CSP directives #1195
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
Conversation
Ah good catch thanks! It seems we have the same issue with What you should do is set the strictest policy possible in the dummy app, then use the smallest possible fix in the engine. In that case, if the dummy app disallows everything with |
Hi @etiennebarrie, thanks for the pointers! To be as conservative as possible, I did set I had to keep both |
I have signed the CLA! |
My understanding is that it's the opposite we want: if the application is using specific directives, but the engine defines fallback directives, we have the bug you're reporting where the more specific directives apply and script/styles are not allowed. So we want the dummy app to be super specific and to not use fallbacks, that way it forces the engine to use the most-specific directives to make sure it overrides what needs to be overridden. I think the engine just needs to be changed to
It's a feature request that we had to be able to render the engine into the application as an iframe: #168 #170 |
script-src-elem
directive in the CSP
Indeed, I did update the dummy app to list all possible CSP directives (all those available in ActionDispatch except the ones unsupported in Selenium), to ensure that indeed the directives are set as specifically and not thanks to fallbacks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your contribution!
Just realized this broke Safari. Somehow it uses style-src even when style-src-elem is set. |
Hello @etiennebarrie which safari are you using ? I do get working styles with the latest version 2.12.0 locally |
Version 18.5 (20621.2.5.11.8), the one that ships with macOS 15.5 released a few days ago. |
We wanted to try out this gem in our repo but we're using the
script-src-elem
directive in our CSP for<script>
inline tags, which fallbacks toscript-src
if unset.But since
script-src-elem
is not defined in maintenance-tasks, we're seeing the following error at this moment:Opening this as draft for now since there are no tests yet