logoalt Hacker News

Jach • yesterday at 11:03 PM • 0 replies • view on HN

Besides specifying scripts by hashes, you can also whitelist various domains: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP (and https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/...)

Feels nice knowing several years ago I worked on forcing CSP (including removing unsafe-eval) on some customers for a site builder product, as they have to manually whitelist domains which limits the impact of these sorts of attacks...

This writeup https://blog.report-uri.com/worlds-largest-brands-infected-w... has a section on how CSP helped (or didn't) in this attack.