logoalt Hacker News

socketclusterlast Wednesday at 9:33 PM1 replyview on HN

This is a good API. I hope it gains adoption in at least one browser, that way other browsers which don't adopt it will be called 'insecure'... Which would be warranted IMO... People have been wanting the ability to inject safe HTML for almost as long as JavaScript existed.

Seriously, we got CSP before setHTML() WTF!

CSP is nasty. Removing essential functionality to mitigate possible security flaws, ignoring the developer's intent. CSP is like taping your mouth shut to lose weight... But you still sit through 3 meals a day... Basically smashing the food against your face.


Replies

embedding-shapelast Thursday at 12:05 AM

> CSP is nasty

Despite the very graphical description, I still don't understand why you don't like CSP. As the server owner, you set your own CSP rules, and if you don't want anything removed, don't configure it like that? It's all opt-in.

Obviously it doesn't fix all classes of potential security issues, but neither would anything else either, it's just one piece of the puzzle.