Optimizely shows the limits of trusted JavaScript
On 16 November, visitors to 178 organizations received malicious JavaScript through Optimizely's web experimentation platform. The list included Zoom, the BBC, CNN, Salesforce, GitLab, IKEA, HSBC, Equifax, Air France-KLM, Ledger, and Peacock. The code was served from cdn.optimizely.com, with Optimizely's certificate, from a host the affected sites already trusted. It was not a CDN cache-poisoning attack. The attacker had written code into the customers' own Optimizely project configuration, and the platform served exactly what it was given.
That distinction is the uncomfortable part. The usual supply-chain advice is to use a reputable CDN, pin versions, and add Subresource Integrity. Those measures assume the threat is a compromised origin or a tampered file in transit. Here, the origin was working as designed. The malicious code was inside the customer's own configuration, and the vendor's infrastructure delivered it with a valid certificate. Trust in the host was not enough.
What the attackers changed
Optimizely Web works by having each customer load a JavaScript snippet from Optimizely's CDN, or from a customer-controlled host. The snippet contains Optimizely's code, the customer's experiments, and an optional field called projectJS, which is custom code the customer writes in the Optimizely dashboard and which runs on every page.
The attacker wrote their own code into the projectJS field of many customer projects. The rest of each snippet was untouched. The injected loader pointed to https://1688360.cc/track.js. Report URI found three variants: a plain script tag, the same URL hidden in base64 and decoded with atob(), and a full inline copy of the payload that runs through eval if the domain is blocked. Some customers served the snippet from their own domain, but those were affected too because the content came from the same Optimizely project.
Report URI is careful about the root cause. It says it does not know how the attacker got write access to so many unrelated customer projects. Optimizely did not respond to Ars Technica's questions. The CDN served what it was given; the question is who was allowed to give it.
The payload was multi-purpose
The injected track.js was not a single exploit. Report URI describes four capabilities that were active at the same time.
First, crypto address swapping. The script searched for valid wallet addresses across Bitcoin, Ethereum and EVM chains, TRON, Solana, TON, Litecoin, Bitcoin Cash, and Dogecoin. It validated checksums so it only replaced real addresses, and it swapped them in page text, form fields, links, images, the clipboard, outgoing fetch and XHR requests, window.open, navigation, and the iOS share sheet. Report URI says funds were already stolen; it lists verified transactions to the attackers.
Second, card skimming. Added later in the day, the script watched form submissions and fetch/XHR POSTs for a card number that passed the Luhn check, an expiry date, and a CVV. When it had all three, it sent them to https://1688360.cc/card.php with navigator.sendBeacon. Cards entered in hosted payment iframes such as Stripe and Adyen were out of reach. Cards typed into a site's own form fields were not.
Third, cookie and screenshot theft. When the script swapped an address next to wallet or payment wording, it sent document.cookie, the original address, and a screenshot of the page to https://1688360.cc/hit.php. That is a broad data exfiltration capability disguised as a wallet attack.
Fourth, iOS exploit kits. On iPhones and iPads, the script loaded boot.js from two .icu domains and read the iOS version to choose an exploit chain in a hidden iframe. Report URI says Coruna covered iOS 13 to 17, DarkSword covered iOS 18.x, and a separate chain for iOS 26 fingerprinted devices but did not appear to do anything else. The exploit kits are the most serious part of the campaign because they can turn a visit into a device compromise, not just a data theft.
The scale and the timeline
Report URI fetched 1,611 distinct Optimizely snippets, mostly from its own crawl data, and checked each one for the malicious code. It found 188 snippets belonging to 178 organizations infected. It says the real number is likely higher because it could only check the snippets it found in time.
The timeline is compressed. The first Optimizely injection was seen at 04:21 UTC on 16 November. The track.js domain was registered at 05:23. The first build of the crypto clipper appeared at 08:10. The card skimmer was added at 13:43. A second iOS host was registered at 16:38, and the Coruna iframe was injected into iOS 18.6-or-earlier visits between 17:13 and 17:57. At 19:24 to 19:59, Report URI's sweep found 186 of 1,611 snippets infected. Mass clean-up followed between about 20:40 and 21:10. At 21:52, one of 188 snippets was still infected.
The payload was rebuilt 26 times during the day. The attacker added features and wallets but never removed any. Smartsheet's snippet was cleaned at one point and then re-infected with a base64-obfuscated loader, which suggests the attacker still had access at the time. That is the worst-case pattern for incident response: the defender cleans the visible artifact, and the attacker re-injects because the access path is still open.
Why CSP did not save everyone
Report URI evaluated 256 of the affected organizations' own hosts against what the payload needed: load track.js from 1688360.cc, run the inline fallback if that was blocked, send stolen data to 1688360.cc, and load the iOS kit. It found that 68 organizations had no CSP at all. Only 24, or 15%, would have blocked the payload.
The detail that matters is why the other sites failed. Allowing cdn.optimizely.com was never going to help, because the malicious code came from that trusted host. What separated the protected sites was a restrictive script-src. Two common settings let the attack through: 'strict-dynamic', which trusts any script that a trusted snippet inserts, and broad allowlists that include the attacker's domain or permit inline/eval fallbacks. A CSP that only says "load scripts from our CDN and a few partners" is not a defense against a compromised partner.
That is not an argument against CSP. It is an argument for writing CSP as if every third-party script is hostile. A restrictive script-src with nonces or hashes, a tight connect-src, and a frame-src that does not allow arbitrary .icu domains would have blocked major parts of this campaign. The problem is that many sites cannot adopt those policies without breaking their marketing stack. The marketing stack is exactly what was compromised.
Why SRI is not enough
Subresource Integrity is the usual answer to a compromised CDN. It lets a page specify a cryptographic hash for a script, and the browser refuses to execute the script if the hash does not match. That works for versioned libraries that rarely change. It does not work for a snippet that is designed to change per customer, per experiment, and per page load.
Optimizely's snippet is dynamic by design. The customer edits experiments in a dashboard, and the platform serves the result from a shared CDN. A fixed SRI hash would break every time an experiment changed, which is the whole point of the product. Even a per-customer hash would not help if the attacker can change the customer's configuration; the hash would match the malicious version. SRI protects against a tampered file in transit or at the origin, not against an authorized change to the content.
The same limitation applies to a lot of modern third-party JavaScript. Tag managers, analytics bundles, chat widgets, and A/B testing tools are intentionally dynamic. They have to be, or they would not be able to do their jobs. That means the security model cannot rely on the file staying the same. It has to constrain what the file can do at runtime.
CSP is the better tool, but it has to be written for this threat. A policy that allows the vendor's host and nothing else still allows the vendor's code to load the attacker's script if the vendor's code has been modified. A policy that uses nonces or hashes for every script, restricts connect-src to known data destinations, and blocks inline/eval fallbacks is much stronger. The trade-off is that it requires the site owner to know every data destination the application needs, which is often not documented.
What to do
The first step is inventory. Every third-party script that can execute on your pages is part of your attack surface, even if it comes from a reputable vendor. That includes analytics, experimentation, tag managers, chat widgets, payment SDKs, and support tools. For each one, ask: who can change the code, what can the code access, and how would we know if it changed?
The second step is to reduce write access. A vendor platform that lets any user with the right role inject arbitrary JavaScript into every customer page is a high-value target. Use the least privilege the platform allows, require strong authentication, review roles, and remove stale users. If the vendor supports approval workflows for script changes, use them. If it does not, ask why.
The third step is monitoring. Report URI's own product pitch is relevant here: detect unexpected changes to trusted JavaScript, new scripts being loaded, and new data destinations. That is not a substitute for prevention, but it shortens the window between injection and discovery. A hash of the snippet, a diff of the rendered page, and an alert on new outbound domains are all useful signals.
The fourth step is incident response. If a third-party script is compromised, you need a way to disable it without taking down the site. A feature flag, a tag manager override, or a CSP change can stop the bleeding. You also need to know what data the script could have accessed, which means understanding its permissions and its position in the page. "It was just analytics" is not a sufficient answer if the analytics script can read cookies and form fields.
What to watch
The root cause is still unknown. Optimizely has not publicly explained how the attacker got write access to so many customer projects. Until it does, customers cannot know whether the access path is closed. The affected list is also incomplete; Report URI says the real number is likely higher. Organizations that used Optimizely Web during the window should check their own snippets and their own logs, not just wait for a vendor notice.
The iOS exploit kits are the part that deserves the most attention. A malicious script that steals crypto is bad. A script that delivers a device exploit chain is a different category. Report URI says it does not know how many devices were successfully infected, and the exploit chains may have been limited by iOS version and device state. The uncertainty is not reassuring.
The broader lesson is that "trusted JavaScript" is a contradiction. Trust is a property of a relationship, not a file. The file can change, the relationship can be abused, and the certificate will still be valid. The only durable defense is to constrain what the script can do, monitor what it actually does, and assume that any third-party code with write access to your page will eventually be a target.
Sources
- Report URI: World's largest brands infected with malware via Optimizely
- Ars Technica: Hundreds of websites deliver potent malware cocktail
- Cynet: OptimJack malicious web injection