This got me interested - care to provide a reasoning behind it? I'd love to read more on the subject and better understand it.
Thanks.
My reasoning is in the next sentence: «Incredibly user-hostile and worse, effectively irreversible—there's basically no going back now because browsers don't have the option at this point to say, "Yeah, we're not going to honor this anymore," without putting users at an even greater risk than before CSP ever existed.»
There's a similar effect with CSP: server operators and content authors can use CSP to prevent the use of bookmarklets that ordinarily work by overriding the author's style rules through $element$.style (i.e. the style attribute), inserting style elements with the user's own CSS, or loading/linking against off-site style sheets.
See also:
Google's WEI ("Web Environment Integrity") proposal from earlier last year that was justifiably opposed by pretty much everyone[1]
The W3C's Priority of Constituencies[2] (part of its Web Platform Design Principles) and its Ethical Web Principles related to putting users in control[3]
1. <https://en.wikipedia.org/wiki/Web_Environment_Integrity>
2. <https://www.w3.org/TR/design-principles/#priority-of-constit...>
[1] https://drafts.csswg.org/cssom/#concept-css-style-sheet-orig...
I disagree. Like many things, it's a trade-off, in this case between configurability and extensibility for those who know what they're doing and security for those who don't. In the grand scheme of things, it seems pretty reasonable.
I don't understand the problem. This is exactly the use case for CSP - allow the server to lock down to a more restricted, and safer subset of the web platform. It plays an important part in providing a failsafe for displaying untrusted/user content on the web (and elsewhere).
I know of one podcast client that uses CSP to safely render HTML podcast notes, blocking the loading of images and any external assets. Pretty neat if you ask me.
Why do you think CSP is user hostile?
I inject code into every site I visit.
For local-user-initiated scripts, this restriction is unnecessary. The server has limited what scripts it itself can run, but that shouldn’t impact what scripts the user can run.
I agree with the !? sentiment. An even bigger WTF, though, is that the server gets to control through CSP which off-site style sheets the user can link against and even whether use of the style attribute is permitted. CSP is one of the worst pieces of Web security infrastructure that modern browsers unwisely agreed to go along with. Incredibly user-hostile and worse, effectively irreversible—there's basically no going back now because browsers don't have the option at this point to say, "Yeah, we're not going to honor this anymore," without putting users at an even greater risk than before CSP ever existed. So not just detestable in the vein of WEI, but an utterly abominable technical work.