Optimizely Served Malware to 178 Organisations. A Content Security Policy Blocked It for Only 24.
The policy pattern Optimizely's own documentation recommends let the loader through. Older host allowlists stopped it.
On 16 November 2026, the Optimizely experimentation snippet on the websites of 178 organisations began delivering a crypto address swapper, a card skimmer and exploit kits aimed at older iPhones. The BBC, CNN, Zoom, HSBC, Salesforce, GitLab and IKEA were on the list. Nothing published so far suggests their own servers were breached. The file arrived from Optimizely's CDN, under Optimizely's certificate, at the URL each site already loaded.
Report URI, the team that found the campaign, then did something more useful than counting victims. It looked at the Content Security Policy each affected organisation was sending and sorted the policies by outcome. A policy stopped the payload at 24 organisations. The result that deserves attention is which kind of policy landed in which group, because the pattern most teams now treat as the modern default is the one that let the loader through.
What happened on 16 November
Optimizely Web lets a customer paste custom code into a field called Project JavaScript. That code is compiled into the customer's snippet and runs on every page that loads it. According to Report URI and a separate analysis by StepSecurity, the attacker wrote a loader into that field across many unrelated customer projects. The rest of each snippet was untouched. The CDN was not poisoned. It served what the platform told it to serve.
The first injected snippet Report URI could date was the BBC's, at 04:21 UTC. A clean capture of the same file exists from 02:21. The domain that hosted the main payload was registered at 05:23, about an hour after the first injection, and its track.js file was rebuilt 26 times during the day. The server sent a 15-second cache lifetime, so the attacker could change behaviour for every visitor within seconds. A card skimmer was added at 13:43. The iOS exploit stage was extended in the late afternoon.
Report URI swept 1,611 Optimizely snippets and found 188 infected, belonging to 178 organisations. Mass clean-up ran from about 20:40 UTC, and every file it monitored was clean by 23:11. StepSecurity puts the exposure window at roughly 16 hours for most sites. Both note that the real count is probably higher, since only snippets found in time could be checked.
Optimizely's status page says an unauthorised party exploited a vulnerability in Experimentation, and that the flaw has been fixed, the injected code removed, sessions ended and tokens revoked. StepSecurity reports that a spokesperson located the flaw in the account signup flow. How a signup bug produced write access to other customers' projects has not been explained. Malwarebytes has a plain-language account for anyone who visited an affected site that day.
The visible takings were small. Report URI traced about $7,040 into the attacker's wallets by the evening of the 16th. That figure says little about the damage, because skimmed cards, stolen cookies and any compromised phone leave no trace on a blockchain.
How each Content Security Policy fared
Report URI crawled the hosts of the affected organisations and tested each policy against what the payload needed: permission to fetch a script from a new domain, permission to run an inline copy through eval if that fetch failed, and permission to send stolen data out. It published outcomes for 159 organisations.
| Outcome | Organisations | What reached the visitor |
|---|---|---|
| No CSP at all | 68 | Everything: address swapping, card skimming, cookie and screenshot theft, iOS stage |
| CSP present, payload and exfiltration both allowed | 50 | Everything |
| Payload ran, connect-src blocked exfiltration | 17 | Address swapping still worked. Card, cookie and screenshot theft failed |
| Payload blocked | 24 | Nothing from the second stage |
Read the first two rows together. 118 of 159 organisations, 74%, had no effective protection, and 50 of those had done the work of writing and shipping a policy. A header that exists is a different thing from a header that constrains anything.
Report URI's finding on what separated the groups is short. Listing cdn.optimizely.com as a trusted host made no difference, since the malicious code came from that host. A restrictive script-src was the separator. Policies containing 'strict-dynamic' or 'unsafe-eval' let the payload run.
Why the recommended pattern passed the loader
A nonce-based policy with 'strict-dynamic' works like this: the server puts a random nonce on the script tags it wrote, the browser runs only those, and any script that a trusted script adds to the page inherits that trust. Host allowlists are ignored in browsers that support the keyword. The design exists because host allowlists grew long and were regularly bypassed, and because it defeats the classic injection attack. An attacker who can inject markup into your page does not know the nonce.
On 16 November the attacker was not injecting markup. The attacker was writing inside a script the site had already blessed with a nonce. When that script created a new script element pointing at an unknown domain, the browser did what the policy said and extended trust to it. Optimizely's own CSP documentation tells customers to add a nonce and 'strict-dynamic' to script-src, and says the directive can be reduced to those two values in supporting browsers. Customers who followed the vendor's instructions had a policy that could not see this attack.
None of this makes 'strict-dynamic' a mistake. It is scoped to a threat model in which your trusted scripts stay trustworthy. A vendor snippet with a customer-editable code field, guarded by the vendor's access controls, does not fit that model. A plain host allowlist, the older and less fashionable approach, refused the fetch because the attacker's domain was not on the list.
'unsafe-eval' was the second door. One loader variant carried a full inline copy of the payload and ran it through eval when the external fetch was refused. Report URI gives HSBC as the example: its policy blocked track.js, and the inline copy ran anyway.
What script-src could not have stopped
That leaves connect-src as the control that still works when the code is already running, because stolen data needs somewhere to go. The 17 organisations in the third row show both its value and its limit. Their card numbers, cookies and screenshots stayed put. The address swapper kept working, since rewriting a wallet address on the page requires no network request at all.
Three other defences that sound applicable were not. Subresource Integrity pins a script to a hash, and an experimentation snippet changes every time someone publishes a test, so there is no stable hash to pin. Serving the snippet from your own domain changes the hostname and nothing else; customers doing that were infected too. Consent banners decide when a script runs, not what it contains.
The custom-code field is a deploy path
Most engineering teams could describe, in detail, how code reaches their production site: a pull request, a review, CI, a deploy with a log entry. Project JavaScript is a second route to the same destination with none of those steps. Its access control lives in another company's product, and on 16 November that access control is what failed.
Optimizely is one instance. Tag managers, chat widgets, session replay tools, consent platforms and personalisation engines commonly offer a text box that turns into JavaScript on your pages. For each one, four questions are worth an afternoon: which pages load it, who can edit it, is there a change history, and would anyone notice a change within the hour.
Five changes worth making this week
- Take vendor-editable scripts off sensitive pages. Checkout, login, and any page that displays payment instructions or bank details. The skimmer could not read card fields hosted by a payment provider in a cross-origin iframe, so provider-hosted fields are worth the integration effort.
- Add a `connect-src` allowlist. It is the directive that limits a script you already trust. List your own API origins and each vendor's documented endpoints, and nothing with a wildcard broader than you can justify.
- Remove `'unsafe-eval'`. Find out which dependency still needs it and replace or isolate that dependency. One affected bank lost its protection through this keyword alone.
- Turn on CSP reporting, in report-only mode if you must. A report-only policy with a host allowlist blocks nothing, and it would still have produced a violation report naming an unknown
.ccdomain from the first affected page view. - Watch the file you are served. Fetch each third-party snippet on a schedule and alert when a hostname appears that you have not seen before, or when
atob(oreval(shows up. Marketing teams change these files legitimately, so alert on new destinations, not on every diff.
Where a page has to run an experimentation snippet, a host-allowlist policy along these lines is a starting point. The hosts are the ones Optimizely documents; deploy it as Content-Security-Policy-Report-Only first and read the reports before enforcing.
Content-Security-Policy:
default-src 'self';
script-src 'self' https://cdn.optimizely.com;
connect-src 'self' https://logx.optimizely.com;
style-src 'self' https://*.optimizely.com 'unsafe-inline';
img-src 'self' https://cdn.optimizely.com;
frame-src 'none';
report-to csp-reportsThe trade is explicit. This policy gives up the injection resistance of nonces on that page in exchange for refusing scripts from hosts you never listed. On a marketing page that runs experiments and holds no session worth stealing, that is usually the better trade. On an application page, the better answer is not to load the snippet. Set session cookies as HttpOnly either way: the payload could only read cookies that JavaScript could read.
What is still unknown
Three questions were open at the time of writing. How a flaw in a signup flow became write access across tenants. How many organisations beyond the 178 were affected and never observed. Whether any device was compromised through the iOS chains, which public scans show being delivered but not succeeding. Customers should ask Optimizely directly which of their projects were modified and when.
The next incident of this kind will arrive through a different vendor's text box, and the organisations that come through it untouched will be the ones that already know which text boxes can write to their pages.
Frequently asked questions
Related reading
Microsoft 365 Went Down With No Traffic Spike. Load Balancer Health Checks Need a Removal Limit.
Microsoft said load rose because servers were removed, not because traffic grew. Here is how health checks turn into a cascade, and the removal floor each major load balancer offers.
Daylight Saving Ends 25 October (EU) and 1 November (US). Know What Your 01:30 Scheduled Job Does
Two clock changes arrive in the next two weeks. Here is what daylight saving does to cron jobs, application schedulers and "daily" reports, and how to decide which jobs belong in UTC.
A Server Response Crashed Thousands of iOS Apps at Launch. Your SDK Is a Remote Control.
A malformed server payload crashed thousands of iPhone apps through the Firebase SDK. No app shipped a bug. Here is how to stop a vendor backend from deciding whether your app opens.