On 16 November, visitors to the websites of at least 178 organisations, among them Zoom, the BBC, CNN, Salesforce, GitLab, IKEA, HSBC and Equifax, were served malicious JavaScript through Optimizely, the web experimentation platform those sites load on every page. The code swapped cryptocurrency wallet addresses, skimmed payment cards, stole cookies and screenshots, and sent iPhone and iPad visitors to iOS exploit kits.
Nothing on the victims' own servers was touched. The tampered files came from Optimizely's own content delivery network, signed with a valid certificate, so browsers had every reason to trust them. That is the part every team embedding third-party scripts should sit with.
How the code got in
Optimizely told BleepingComputer that an attacker exploited a vulnerability in the signup flow for its Experimentation accounts and used it to add JavaScript to some customer projects. The company says it blocked the vulnerable path, deployed a fix, removed the injected code, ended active sessions, revoked tokens and reset access for affected accounts, and has notified affected customers. It has not said how many customers were hit.
Scott Helme of Report URI, who uncovered the attack, examined 1,611 Optimizely scripts and found 188 infected ones. According to his findings, the code sat in the optional Project JavaScript field, which customers use for their own code and which runs on every page. His timeline puts the first injection at 04:21 UTC on 16 November; by 21:52 UTC only one infected file was left, and he later confirmed all were clean. Helme thinks the real number of victims is higher, because his team only checked the snippets it could find in time. Banks and financial firms were the largest group, with 32 organisations. Salesforce says it has disabled Optimizely scripts across its preview and production instances while it investigates.
What the payload did
The injected snippet loaded a script called track.js from a domain registered that same morning. Some copies also carried a full embedded version of the payload that would run if the remote file was blocked, so blocking the attacker's domain alone was not enough, Hudson Rock warned. Helme says the payload was rebuilt 26 times during the day as features and wallets were added.
The skimmer only caught card details typed into a site's own forms. According to Ars Technica, payment fields hosted by providers like Stripe and Adyen inside iframes were not affected. The attacker's wallets took in roughly $7,000 before being emptied, and Helme says there is no way to know how many cards were skimmed.
The iOS side is less certain. Report URI says Coruna and DarkSword exploit kits were delivered to iPhones and iPads, and Ars reports the two cover iOS 13 to 17 and the 18.x releases. Hudson Rock confirmed the link to exploit-kit infrastructure but says successful exploitation of a real device has not been shown. Hudson Rock and a researcher at Ohey also found the same iOS-targeting infrastructure behind tampered scripts from Kissmetrics, StorifyMe and Minute-ly, the earliest from 13 November. How the code reached those providers is unknown, and the researchers say shared infrastructure does not prove a single operator.
Why most security policies did not help
Helme's team crawled the affected sites to see whether a Content Security Policy would have stopped the attack. Only 24, about 15%, had a policy strict enough. Another 68 had none, and in 50 cases the policy let the malware run and send data back to the attacker.
Allowing Optimizely's domain in a policy was useless, since the malware came from that domain. Worse, Optimizely's documentation recommends allowing eval, and Help Net Security reports that setting let the backup copy of the payload run on HSBC's site.
What to do
- If your site loads Optimizely Web, review your Project JavaScript for unexpected code and check the indicators of compromise published by Report URI and Cynet.
- Tighten your Content Security Policy so third-party scripts cannot send data to arbitrary domains, and avoid allowing eval where you can.
- Move card entry into a hosted payment iframe so a compromised script on your page cannot read card numbers.
- Tell users who visited affected sites on 16 November to check crypto transfers and card statements, and to update iPhones and iPads to the latest iOS.
Sources
- Optimizely supply chain attack infects major brands' sites with malware BleepingComputer
- Optimizely Vulnerability Exploited to Serve Malware on Major Websites SecurityWeek
- Malware spread through Optimizely hits 178 organizations, including BBC, CNN and Zoom Help Net Security
- Hundreds of websites deliver potent malware cocktail to unsuspecting visitors Ars Technica

