logoalt Hacker News

stavros • yesterday at 11:06 PM • 1 reply • view on HN

SRI helps you make sure the script you're loading is what you initially thought, but doesn't ensure that script doesn't load other scripts, no? You need CSP for that.


Replies

technion • yesterday at 11:47 PM

Specifying scripts by hashes is always a solid defense that platforms like this don't change their script after compromise - but in practice the whole point of optimizely and similar tools it that it's expected the script will change.

Common examples like analytics tools happily change their script bundles whenever they feel like it without just tagging a new version and letting you upgrade.

I wish SRI could be used more,