On Monday the security researcher Scott Helme published a report showing that malicious JavaScript had been served to visitors of 178 organizations through Optimizely, a service companies use to run A/B tests on their websites. The list includes Zoom, CNN, the BBC, Fox News, Salesforce, GitLab, IKEA and HSBC. BleepingComputer confirmed the injected script on many of those sites using urlscan.io records. Optimizely acknowledged the incident on its status page, saying an unauthorized party "exploited a vulnerability in Experimentation and used it to add malicious JavaScript to some customer projects."
I have run ad-supported tech sites for about 20 years and this is the kind of incident that worries me most as a publisher. None of these companies had their own servers broken into. Their pages loaded a script from a vendor they trusted and the contents of that script changed.

What happened
Each Optimizely customer loads a snippet of JavaScript from Optimizely's CDN. The snippet includes an optional field called Project JavaScript, which is custom code that runs on every page. According to Report URI, the attacker wrote a short loader into that field in customer projects and left the rest of the file alone. The file was still served from Optimizely's domain with Optimizely's certificate, so nothing about it looked unusual to the sites loading it. Optimizely told CoinDesk that the attacker exploited a flaw in its account signup flow. It has said it fixed the vulnerability and removed the code, but it has not said how many customers were affected, as SecurityWeek notes.
The loader pulled in a second script that did several things at once. It swapped cryptocurrency wallet addresses on the page and in the clipboard for the attacker's addresses. It captured card numbers, expiry dates and security codes typed into a site's own forms. On older iPhones and iPads it loaded two known iOS exploit kits. Report URI counted about $7,000 sent to the attacker's wallets and says it has no way to see how many cards or cookies were taken.
| Time | Event |
|---|---|
| Sun Nov 15, 11:21 PM | First injected code seen in the BBC's Optimizely snippet |
| Mon Nov 16, 3:28 AM | Main malicious script first seen loading on bbc.com |
| 8:03 AM | Attacker moves stolen crypto out of its wallets |
| 8:43 AM | Card skimmer added to the script |
| 2:24 to 2:59 PM | Report URI sweep finds 186 of 1,611 snippets infected |
| 4:52 PM | Only 1 of 188 infected snippets still has the code |
| 6:11 PM | All infected snippets Report URI monitors are clean |
| 8:02 PM | Optimizely posts its incident notice |
Source: Report URI timeline and Optimizely status page, converted from UTC.
Why this matters to publishers
News and media accounted for 10 of the 178 organizations. That number is less important to me than how ordinary the setup was. HTTP Archive's Web Almanac found that around 90% to 92% of pages use at least one third party and that the median third-party inclusion chain is three deep, which means most third parties on a page load at least one more. On ad-supported sites I would expect those chains to be longer, because ad code calls other ad code during each auction. I can review the scripts I add to my own pages. I can't review what they load after that and I can't review what they will contain next week.
Optimizely was also not the only route. Report URI's timeline shows the same actor's injector going out through scripts from three other third-party services starting November 13. Help Net Security reports the same finding from Hudson Rock, which adds that shared hosting and loader code don't prove a single operator.
What I'm going to change
One detail in the report is reassuring for a small business like mine. The skimmer could not read card details entered in hosted payment frames from companies such as Stripe and Adyen. Advertisers who pay me do it on Stripe or PayPal invoice pages hosted by those companies, so a card number never touches a form on my sites. I would not move payments onto my own pages for a slightly smoother checkout.
The second change is a Content Security Policy. Helme recommends one to affected companies and writes that a policy in enforcement mode could have blocked key parts of this attack. That makes sense to me, since the payload had to load from and send data to a domain no site had a reason to allow. On a page full of ad code an enforced policy is hard to maintain because the list of ad domains changes often. I plan to start in report-only mode, which logs every script source without blocking anything. After that I would enforce it first on login and advertiser pages.
The third is removing scripts that don't earn their place. Every testing tool, widget and analytics tag I have added over the years is a company that can run code on my readers' devices. If one is no longer used, it should come out.
I expect more incidents like this over the next year and I expect most of them to come through services that sit on the largest number of pages, such as testing, analytics and ad tech, because one compromised account there reaches many sites at once. The companies on this list have far larger security teams than I do and the code still ran on their pages for most of a day.