Skip to content
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

Don't penalize 'unsafe-inline' if hash or nonce source is used, in CSP test #88

Closed
romainneutron opened this issue Aug 26, 2016 · 6 comments

Comments

@romainneutron
Copy link

romainneutron commented Aug 26, 2016

Hello,

After analyzing blackfire.io https://observatory.mozilla.org/analyze.html?host=blackfire.io , the report tells me:

Content Security Policy (CSP) implemented, but allows 'unsafe-inline' inside script-src

This is true in case of CSP level1. However, since level2, it's recommended to add unsafe-inline to the script-src directive when you're using a nonce or a hash. In this particular case, the unsafe-inline is discarded, except for browser that do not support CSP level2.

What about taking care of this?

@april
Copy link
Contributor

april commented Aug 26, 2016

Oh, this is a good catch. I'll try to work up a code fix for this over the next week. Thanks for pointing that out. Despite working with CSP for so long there are still sometimes little things that are easy to miss.

Thanks for reporting!

@romainneutron
Copy link
Author

No problem :)

@mikispag
Copy link

+1 on this!

@april april changed the title CSP level 2 issue Don't penalize 'unsafe-inline' if hash or nonce source is used, in CSP test Aug 30, 2016
april added a commit to april/http-observatory that referenced this issue Aug 30, 2016
@april
Copy link
Contributor

april commented Aug 30, 2016

This should be live now, and I can see that it's now judging things at least more correctly. Let me know if it's still behaving incorrectly, and thanks so much for reporting the bug!

gdestuynder pushed a commit to gdestuynder/http-observatory that referenced this issue Sep 1, 2016
@fmeum
Copy link
Contributor

fmeum commented Sep 20, 2017

Following CSP level 2, 'unsafe-inline' in 'style-src' should probably be treated in a similar way.

@april
Copy link
Contributor

april commented Sep 22, 2017

Could you open up a new bug for that, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants