Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Error in Content-Security-Policy HTTP header #915

Closed
louisjc opened this Issue Jun 24, 2015 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

louisjc commented Jun 24, 2015

There is an error in the Content-Security-Policy HTTP header.
content-security-policy = : script-src 'self'

The value start from ":" but shouldn't, so it is invalid and does not work. I can't make a pull request about it because this concerns nginx configuration which is not accessible in this git.

EDIT: For those who did not know, this header forbidden to load external scripts on the whole site. This protect a page against a cross site scripting attack.

The thing is that the home page Youtube player is loading 3 external js. I think fixing this issue would break the player. To keep both the Content-Security-Policy and the Youtube player, we could white list google's js as follows:

content-security-policy = script-src 'self' s.ytimg.com google.com

Contributor

saivann commented Jun 24, 2015

@louisjc Thank you very much for catching this issue!

I just fixed the header as follow:
Content-Security-Policy = script-src 'self' 'unsafe-inline';

It turns out that the Youtube video works just fine in IE, FF, CH without using a specific header for Google and Youtube (it's loaded within an iframe).

Maybe this header could be more severe. I haven't really spent much time on it so recommandations are welcome.

Contributor

louisjc commented Jun 24, 2015

Great!

@louisjc louisjc closed this Jun 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment