In the Optimizely attack on November 16, one line in a site’s security headers decided whether visitors ran the attacker’s code or not. Report URI checked the Content Security Policy (CSP) of 159 affected organisations and found that only 24 blocked the malicious script outright. Many of the others had a CSP that relied on the very setting Optimizely’s own example configuration recommends. If your site loads third-party JavaScript for A/B testing, tag management or chat, this incident is worth a close read, because the pattern applies almost everywhere.
What happened in the Optimizely attack
Optimizely Web Experimentation runs through a snippet. Customers load a JavaScript file from cdn.optimizely.com that pulls in their experiments, and that file includes a field called Project JavaScript: custom code the customer writes in the dashboard, executed on every page that carries the snippet. That field is what the attacker rewrote.
According to Optimizely’s public incident write-up, the way in was a flaw in a legacy free-trial signup flow. The attacker created trial accounts, brute-forced the email addresses of real users at customer companies using publicly available information, and then abused an old impersonation feature to act as those users. No passwords were involved. Optimizely says no credentials were stolen and no administrator account was compromised. CISA added the flaw to its Known Exploited Vulnerabilities catalog as CVE-2026-132224 on November 24.
The timelines differ slightly depending on who you ask. Optimizely puts the start of the main wave at 07:51 UTC, while Report URI spotted the first injection in the BBC’s snippet at 04:21 UTC. Both agree that a customer flagged the rogue script at 13:34 UTC, that the hole was closed at 16:10 UTC, and that the code was gone from every project late that evening. Report URI’s own sweep found the loader in 186 of 1,611 snippets it checked, and in 188 snippets belonging to 178 organisations overall, including Zoom, the BBC, GitLab, IKEA and HSBC. Optimizely says fewer than 5 percent of its customers were affected.
One loader, three jobs
The injected code was tiny. It created a script element and pulled track.js from 1688360.cc. Another variant hid that URL in Base64 and decoded it with atob(), so a plain text search would miss it. A third carried the whole payload inline and ran it through eval() in case the domain was blocked.
The payload itself was rebuilt several times during the day. It started by replacing cryptocurrency wallet addresses that visitors copied or typed with the attacker’s own. From 13:43 UTC it also lifted card numbers, expiry dates and CVVs from form fields on the page. It sent any cookies that scripts could read, plus screenshots, back to the attacker’s server. On iPhones and iPads running older iOS versions it loaded a second stage that researchers identified as the Coruna and DarkSword exploit kits. Optimizely says it is still assessing whether any devices were actually compromised.
The only damage anyone can measure so far is the crypto. Report URI counted roughly $7,000 arriving in the attacker’s wallets that day. Nobody knows how many cards were skimmed, because the script ran inside visitors’ browsers, out of sight of both Optimizely and the researchers.
Why allowing cdn.optimizely.com never helped
A CSP is an HTTP header that tells the browser where a page may load scripts from and where it may send data. Any Optimizely customer has to allow cdn.optimizely.com in script-src. The trouble is that the malicious code came from exactly there, over Optimizely’s certificate, through the usual script tag. As Report URI put it, allowing the CDN was never going to help.
What could help was everything that came next. Loading track.js required the browser to accept a script from a brand-new host. The fallback needed eval(). Shipping card data out needed a connection to an unknown destination. A CSP can refuse each of those steps.
Report URI’s numbers show how that played out across 159 organisations. 68 had no CSP at all. For 50, the policy let both the script and the data theft through. At 17, the payload ran, but connect-src stopped cards, cookies and screenshots from leaving the page. Address swapping still worked there, since it happens entirely inside the page. Only 24, about 15 percent, blocked the script completely.
strict-dynamic and unsafe-eval let it in
Two common keywords let the script through despite a CSP. The first is 'strict-dynamic'. With it, the browser trusts a script that carries a valid nonce, a random value generated for each page load and placed on the script tag. Any script that a trusted script adds to the page is trusted as well, wherever it comes from, and modern browsers simply ignore the host allowlist. That is a strong defence against classic cross-site scripting, because an attacker who injects HTML cannot guess the nonce. Here, though, the start of the trust chain was the compromised snippet itself, so the browser handed its trust straight to 1688360.cc.
The awkward part is that Optimizely’s documentation shows exactly this setup. Its example policy combines https://*.optimizely.com with a nonce and 'strict-dynamic', and for modern browsers it suggests the nonce and 'strict-dynamic' alone. In its incident write-up, Optimizely concedes that its guidance did not make clear enough what the right CSP looks like, and says it is revising the docs.
The second keyword is 'unsafe-eval', which some Optimizely features need, such as audiences with custom JavaScript conditions. Report URI describes HSBC as a case where the CSP blocked both track.js and the data theft, yet the inline copy still ran through eval().
A CSP that would have caught it
For a site running the Optimizely snippet, a much tighter policy could look like this. The project ID is a placeholder, and the endpoints come from Optimizely’s documentation:
Reporting-Endpoints: csp="https://example.com/csp-reports"
Content-Security-Policy-Report-Only:
default-src 'self';
script-src 'self' https://cdn.optimizely.com/js/1234567890.js;
connect-src 'self' https://logx.optimizely.com;
img-src 'self' https://cdn.optimizely.com;
style-src 'self' https://*.optimizely.com 'unsafe-inline';
report-to csp
Three choices matter here. Instead of the whole domain, only your own snippet file is allowed, in line with Optimizely’s new advice to permit just the exact sources you use. There is no 'strict-dynamic' and no 'unsafe-eval', so scripts pulled in from foreign hosts and the eval fallback both fail. And connect-src only permits your own origin and the event endpoint. Keep img-src narrow too, since image requests are a common side channel for exfiltration.
The policy deliberately starts in Report-Only mode. The browser blocks nothing but reports every violation to your endpoint. Optimizely suggests collecting a month of reports that cover checkout, login and forms before switching to the enforcing Content-Security-Policy header. Depending on the features you use, the snippet may load more sources, for preview mode or geotargeting for example. They will show up in the reports, and each one deserves a deliberate decision. Be careful with one-click “allow this domain” buttons in reporting dashboards: on November 16, that button would have waved 1688360.cc through.
The cost is maintenance. Without 'strict-dynamic', every new service has to be added by hand, and dropping 'unsafe-eval' may cost you some features. That is a trade-off a team should make on purpose rather than by copying a sample config.
Where a CSP runs out of road
Had the attacker written the full payload straight into Project JavaScript, with no eval() and no new hosts, it would have run on every site that allows Optimizely. The wallet swap would still have worked, because it never touches the network. Only a tight connect-src would have kept cards and cookies on the page. Subresource Integrity, which pins a script to a fixed hash, is not realistic for snippets like this either, because the file changes every time someone publishes an experiment.
So other controls belong alongside the CSP. Keep testing snippets off payment and login pages unless you are actually testing there. Take card details in hosted fields from your payment provider, because input in Stripe or Adyen iframes was out of the script’s reach. Mark session cookies HttpOnly, Secure and SameSite=Lax so page scripts cannot read them. And build a kill switch you control yourself that turns the snippet off in minutes. Optimizely only learned about the attack from a customer, almost six hours after the main wave began.
We saw a similar pattern in late October with the Polymarket hack via a compromised third-party script. If you want to know how to spot a swapped wallet address before you hit send, our guide to crypto scams covers it.
What to do now
If you run Optimizely Web Experimentation, go through your project history and the code in Project JavaScript, experiments and integrations for anything your team did not write. Search for 1688360, atob( and the marker var TCODE=dec(T), and remove users with “+tag” look-alike addresses and webhooks nobody recognises. Optimizely says it has contacted affected customers directly. Report URI also advises treating cards typed into your own forms on November 16 as potentially exposed and rotating session tokens kept in readable cookies. Visitors to affected sites should update iPhones and iPads to iOS 18.7.3 or 26.3 and later and double-check any crypto transfers from that day.
Everyone else can use this as a reason to reread their own CSP with a sceptical eye. If it pairs 'strict-dynamic' with a snippet that loads third-party code, or allows 'unsafe-eval' across the board, it would have done nothing against this attack. A sensible next step is a report-only policy with a tight connect-src, left running for a few weeks to gather data. For another reminder of why browser-side defences matter, see the uBlock Origin universal XSS flaw.
Sources: Optimizely incident update, Report URI analysis, CISA KEV alert.


