The Optimizely supply chain attack is the latest sign that third-party code remains a blind spot. According to the author of a post reflecting on the incident, a large provider of third-party JavaScript was compromised and its code was infected with malware. That infected code was then served on some of the largest websites in the world. The author has reported on this type of attack for more than a decade.
What could the attackers have done? Once someone can inject any JavaScript into a page, only their imagination holds them back. The author sketches a fake breaking news story on the BBC website, stolen logins at Zoom, financial data taken from banks such as HSBC, or passport details on airline sites such as KLM. None of this happened, because the attackers simply chose not to do it.
Most organisations review the code they deploy on their servers. They use source control, automated build and deploy pipelines with testing, and security reviews. For JavaScript, a single script tag tells the browser to fetch and run whatever code it finds at a URL. The author shows zoom.com loading a script from cdn.optimizely.com in exactly that way.
Why is this so hard to fix? Third-party scripts are often dynamic by design, so their code changes regularly for legitimate reasons. That makes it difficult to defend against a JavaScript supply chain attack, because you cannot easily say what good code looks like.
Browsers offer two tools. Subresource Integrity (SRI) checks that a script matches the code you expected. Content Security Policy (CSP) controls where your site may load code from and send data to. According to the author, very few organisations use either.
A CSP in Report-Only mode blocks nothing, but it alerts you when code changes. Report URI says this is how it first spotted the Optimizely malware, when its Threat Intelligence pipeline flagged the first malicious activity on a customer website on 16 November 2026. The author argues visibility beats having nothing.
The advice is simple. Remove dependencies you no longer need, audit the code you run today, and monitor for changes. Security is a sliding scale, and the first step is to find out what code runs on your website right now. As the author puts it, trust, but verify.
Read scotthelme.co.uk article for more information.