Malware hit 178 sites through Optimizely's A/B testing script

Policies of 159 affected organizations: No CSP at all 68, Allowed the script and the data 50, Allowed the script, blocked the data 17, Blocked the script from…

Summary

An attacker wrote malicious JavaScript into 178 organizations' Optimizely Web projects, and it reached visitors from Optimizely's own CDN, a host every affected site already trusted.

Open every Optimizely project's Project JavaScript and experiment code and search it for 1688360.cc and atob(.

Malicious JavaScript ran on the sites of 178 organizations on 16 November, among them the BBC, CNN, Zoom, Salesforce and GitLab, after an attacker wrote it into their projects in Optimizely Web Experimentation, an A/B testing tool. It was served from Optimizely’s own CDN, according to Report URI, the script-monitoring service that found it.

Every Optimizely Web customer loads a JavaScript snippet from cdn.optimizely.com. That snippet holds Optimizely’s code, the customer’s experiments, and an optional Project JavaScript field: custom code written in the Optimizely dashboard that runs on every page load. Scott Helme, who founded Report URI, found that the attacker had written into that field and left the rest of each snippet intact, so the file still came from the vendor host every affected site already trusted. Helme’s team found the code in 188 of the 1,611 snippet files it fetched. Customers who serve their snippet from their own hostname were hit too, because the content comes from the same project.

The loader pulled a second script that replaced valid cryptocurrency wallet addresses in page text, form fields and the clipboard with the attacker’s. A card skimmer was added to it at 13:43 UTC, watching a site’s own form fields for a card number, expiry date and CVV and sending all three to the attacker’s host. Cards typed into hosted payment iframes such as Stripe and Adyen stayed out of its reach; cards typed into a site’s own fields did not. On iPhones and iPads the script loaded the Coruna and DarkSword exploit kits, and pages on iOS 18.6 or earlier reloaded every 60 seconds, the one symptom a visitor could see. The attacker’s wallets had received around $7,040 by that evening.

What a CSP did and did not stop

A Content Security Policy only helped where it limited which hosts could serve scripts at all. Report URI compared the policies of 159 affected organizations against what the payload needed:

What the organization’s policy didCount
No CSP at all68
Allowed the script and the data it sent out50
Allowed the script, blocked the data17
Blocked the script from running24

The 24 that blocked it had a script-src listing only the hosts they actually needed. Where the script did run, a restrictive connect-src kept card data, cookies and screenshots from leaving, but it could not stop the wallet swapping, which happens inside the page.

Adding cdn.optimizely.com to an allowlist was worth nothing here, because the malicious code came from that host. Two common directives made it worse. 'strict-dynamic' extends trust to any script the Optimizely snippet inserts, and 'unsafe-eval' let an inline copy of the payload run through eval on sites where the remote script was blocked. Optimizely’s CSP help page lists 'strict-dynamic' in its recommended script-src. Search Engine Journal’s report says the page’s full sample policy included 'unsafe-eval' as well, which some Optimizely features need; the directive was not on the page when checked on 19 November.

Optimizely’s status page says an unauthorized third party exploited a flaw in the Web Experimentation account signup flow and used it to impersonate users on targeted customer accounts. The company says it detected the activity, blocked delivery and closed the flaw within three hours of detection, that “This was not a credentials breach”, and that “Less than 5% of our customers were impacted”. Those three hours run from detection, not from injection: Report URI first saw the code at 04:21 UTC and found all but one snippet clean late that evening, so anything a visitor typed on an affected site during that day should be treated as exposed. Salesforce told BleepingComputer it had disabled Optimizely scripts across preview and production instances as a precaution.

Nothing in this touched the affected sites’ own code. A field in a vendor dashboard changed what every page executed, with no commit, no deploy and no line in anyone’s release notes. As Helme put it: “A website can be compromised through a third-party dependency without its own code or infrastructure ever being breached.” Injected JavaScript has paid for worse, as in the FBI’s case tying ransomware to SEO poisoning on WordPress.

What to do

  • Open every project’s Project JavaScript and every experiment’s custom code and search for 1688360.cc, atob( and any script your team did not write. One variant hid the domain in base64, so the plain string search misses it.
  • Read the project’s change history in Optimizely, which logs every Project JavaScript change and can be filtered by whether it came through the REST API or the Web Experimentation interface. One snippet was cleaned and then re-infected, so a single clean check is not proof.
  • Review who and what can write to the account, including users, API tokens and integrations, and rotate those credentials.
  • Treat cards entered into your own form fields on 16 November as exposed, and rotate session tokens or secrets stored in cookies that are not marked HttpOnly.
  • Tighten script-src to the hosts you need and restrict connect-src, with reporting switched on, before any Black Friday change freeze starts.