TLDR: don't use 'unsafe-inline'. Good article though.
Neatly Bypassing Content Security Policy
11–20 of 38 posts
Re: Neatly Bypassing Content Security Policy
#12Great article. Why is CSP so under-utilized? Less than 0.2% of the top 1m sites[0]. Although only 9% use basic features like secure cookies, and 6% HSTS. [0] https://blog.mozilla.org/security/2018/02/28/analysis-alexa-...
Re: Neatly Bypassing Content Security Policy
#13Great article. Why is CSP so under-utilized? Less than 0.2% of the top 1m sites[0]. Although only 9% use basic features like secure cookies, and 6% HSTS. [0] https://blog.mozilla.org/security/2018/02/28/analysis-alexa-...
Re: Neatly Bypassing Content Security Policy
#14This is of course not bypassing CSP.
Re: Neatly Bypassing Content Security Policy
#15Re: Neatly Bypassing Content Security Policy
#16Oh, not CSP as in concurrency. Makes more sense now.
Re: Neatly Bypassing Content Security Policy
#17Earlier quoted context omitted.
The deployment difficulty is also high, especially for what it offers. Deploying CSP on anything non-trivial involves a lot of coordination with basically anyone who runs code on your site.
This is the big one. Lots of sites have marketing departments which like to switch out their advertising, engagement, A/B testing, etc. code on a regular basis. Which in turn requires either changing the CSP frequently to accommodate, or else opening holes in the CSP to allow marketing to just copy/paste inline JS and other badness. At which point it's hard to justify CSP.
The spec versions are interesting to read too, as well as browser compatibility. Differences in interpretation of the spec lead to github issues which lead to browsers fixing things in the past few months that have been part of the spec for much longer. (And if you have a big chunk of IE11 users, "what's the point" is valid.) An example of a spec issue is that I'm working on adding an endpoint for the report-uri directive so we can log some metrics but the first thing you see when reading about report-uri is that it's been deprecated in favor of report-to, but literally no stable browser release supports report-to yet.
It's also not really enough. https://github.com/tc39/proposal-frozen-realms is a useful extension, since it would allow frameworks to do what they need to set up everything but then lock down objects from further extension/abuse...
Re: Neatly Bypassing Content Security Policy
#18Oh, not CSP as in concurrency. Makes more sense now.
Re: Neatly Bypassing Content Security Policy
#19Re: Neatly Bypassing Content Security Policy
#20Great article. Why is CSP so under-utilized? Less than 0.2% of the top 1m sites[0]. Although only 9% use basic features like secure cookies, and 6% HSTS. [0] https://blog.mozilla.org/security/2018/02/28/analysis-alexa-...
It may also prevent tooling to work on your site. E.G: bookmarklet won't work anymore. On browsers without extensions, they are the only way to get extra features. It's especially annoying on github.