Comment by technion
11 days ago
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,
I remember a team at my old place bringing down the entire app with insufficient defense around an Optimizely script that failed. Seems bonkers to take on these dependencies and I think it's only going to get worse.
It's a feature. Changes to prod should always be reviewed and this fundamental incompatibility with insecurely hosted JavaScript is a signal that it is a bad idea.
Unfortunately, in this case the insecurely hosted JavaScript is the feature; that is, people who are not responsible for sites going down or breaches want to be able to add things nilly-willy (which therefore necessitates a way to bypass review).
Exactly right.
SRI (or CSP hash, or vendoring) only helps if someone actually reviews the changes instead of automatically approving them. Maybe it's more likely to happen with LLM reviewers, though in such a world, one can also just ask said LLMs to help manage in-house source, or to help leverage a properly versioned and auditable library, to test all the different shades of slop.
Any website that cares about security should have long since moved on from unpinned JavaScript controlled by a third party. It may have made sense 15 years ago, but certainly not in 2026.
(disclaimer: former Optimizely employee)