-
Notifications
You must be signed in to change notification settings - Fork 297
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
Enforce security-related HTTP response headers recommended by https://observatory.mozilla.org/ #1513
Comments
https://observatory.mozilla.org/analyze/demo.shaarli.org
|
Since the web app does not require external resources, the CSP header could be set to something like |
I have it set to I have not tried to replace |
Hello, I think we should make a list of CSP violations for a default CSP with I have a question about the vintage theme, is it still supported? I see multiple inline javascript contents, but I am not sure if we should fix them. I also confirm my web browser reports violation with plugin About |
👍
I wouldn't bother fixing those issues for the vintage theme right now, unless you use it personally.
Worth trying, and checking if that resolves CSP issues (and if the plugin still works with an updated jquery) |
Hello, Thanks for the merging of #2103. About the Content-Security-Policy that I use, I updated it a bit: This won’t work (currently) for the playvideos module since this one uses Youtube’s content, as already mentioned in its documentation. And I guess that’s it, which is pretty good news. |
I tested the plugin
Full value: I still see in the console one CSP violation with jQuery version 1.11.2, however with jQuery 3.7.1, this message is gone. |
In
ApiMiddleware.php
, Shaarli sets a few HTTP response headers (Access-Control-Allow-Methods
,Access-Control-Allow-Headers
,Access-Control-Allow-Origin
). We could augment this list with security-related HTTP headers recommended by https://observatory.mozilla.org/, and add these headers to all Shaarli HTTP responses (not only the API).A vanilla Shaarli installation should pass most tests from the observatory, with minimal configuration required on the webserver side.
For instance we are missing the
Content-Security-Policy
header - I use to set a default, restrictive CSP at the webserver level but this is not documented - then it must be relaxed specifically for this plugin.The text was updated successfully, but these errors were encountered: