Hacker Newsnew | past | comments | ask | show | jobs | submit | nchilada's commentslogin

Ironically, eval & co. don't actually increase the power of Optimizely Web Experimentation scripts, which are designed to support arbitrary customer-specific JavaScript and which primarily do so by compiling custom code into the syntax tree. (I left Optimizely in 2020, but I would be quite confident that the “only” inputs that get eval'd are intended code inputs.)

Softer questions might be: why is eval (still) being used for any inputs at all; and to the extent that it is used, why did¹ the docs not concede the breadth of CSP unsafe-eval (which allows eval in all scripts, not just Optimizely's), and why do the docs actively discourage attempts to enable Trusted Types (which includes the much narrower CSP trusted-types-eval²) instead of actively facilitating its use?

And needless to say, a more direct question would be: why should customers use a class of product that is so powerful that unsafe-eval doesn't increase its capabilities at all?

¹ cf. https://web.archive.org/web/20260810141143/https://support.o... vs. https://docs.optimizely.com/web-experimentation/docs/update-... (updated yesterday).

² ~84% browser support, per https://caniuse.com/mdn-http_headers_content-security-policy...


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)


Some details that may have been missed in the Report URI analysis:

CSP script-src was only helpful here because the attacker used the Optimizely ProjectJS feature to delegate to a third-party script. It wouldn't do a thing if the dirty work had been done in e.g. ProjectJS itself.

CSP connect-src/form-action are somewhat helpful for stopping a script from exfiltrating data to, or redirecting the end-user to, a third-party domain, but an attacker still has plenty of other options (https://github.com/w3c/webappsec/issues/656).

And apparently CSP frame-src would have blocked the iOS exploit, but there's nothing to stop other malicious content (scam propositions, pump-and-dumps, psy-ops, other “truths”...) from being rendered.

(disclaimer: former Optimizely employee)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: