Optimizely Hack: What QA Should Test in Third-Party Scripts

HTML source on a monitor, including third-party CSS stylesheets loaded from a CDN, the kind of external resource that runs on a website

Photo: Sai Kiran Anagani, "CSS code on a screen", CC0, via Wikimedia Commons.

On Sunday 16 November 2026, visitors to Zoom, the BBC, CNN, Salesforce, GitLab and well over a hundred other big websites were served malware. None of those companies had their own servers hacked. The bad code arrived inside a script they already trusted: the snippet from Optimizely, a popular A/B testing and experimentation platform.

This week's breakdown covers what we know about the Optimizely hack, what we still don't know, and, most importantly, what QA and web teams should test so that a trusted third-party script can't quietly turn your checkout into a skimmer.

What happened in the Optimizely hack

Optimizely Web Experimentation works by loading a JavaScript snippet from Optimizely's CDN on every page of a customer's site. That snippet carries Optimizely's own code, the customer's experiments, and an optional field called Project JavaScript, which is custom code the customer writes in the Optimizely dashboard.

According to Optimizely's security advisory, an unauthorized party exploited a flaw in the Web Experimentation account signup flow. That let them act as users on targeted customer accounts and insert malicious JavaScript into those customers' projects. Optimizely says it detected the activity the same day, closed the vulnerability within three hours of detection, and removed the injected code from all affected projects. It says this was not a credentials breach, only Web Experimentation was involved, and fewer than 5% of customers were impacted.

The attack was first made public by Scott Helme of Report URI. In his detailed write-up, his team checked 1,611 Optimizely snippets and found malicious code in 188 of them, belonging to 178 organisations. He believes the real number is higher. BleepingComputer independently confirmed, using urlscan.io captures, that the malicious script loaded or tried to load on sites including Zoom, KLM, GitLab, BBC, CNN, Smartsheet and Salesforce.

What the malicious script did

The injected code loaded a second script from an attacker-controlled domain. Researchers say that script:

  • swapped cryptocurrency wallet addresses on the page and in the clipboard for the attacker's own;
  • skimmed card numbers, expiry dates and CVVs typed into the site's own forms;
  • sent readable cookies, the page URL and a screenshot to the attacker in some cases;
  • on iPhones and iPads, loaded known iOS exploit kits aimed at older iOS versions.

One detail matters a lot for testers. Both Report URI and Optimizely say card details entered in hosted payment iframes (for example Stripe or Adyen) were out of the script's reach. Cards typed into a site's own form fields were not.

What is still uncertain

Reports differ on a few points, so treat them with care. Optimizely's incident report says the first malicious code was written at 07:51 UTC on 16 November. Report URI says it saw a first injection on a BBC snippet at 04:21 UTC that morning. Report URI also counted about $7,000 in crypto sent to the attacker's wallets, but nobody outside the attacker can see how many cards, cookies or devices were actually compromised. Optimizely has brought in Mandiant to investigate, and the final root cause and full indicator list are still pending.

Why this is a QA problem, not just a vendor problem

As Helme put it, the victims' own infrastructure was untouched. A vendor's script turned hostile and their sites served it to every visitor. Allow-listing cdn.optimizely.com did not help, because the malicious code came from that trusted host.

Tag managers, analytics, chat widgets and A/B testing tools all work the same way: they can change in production without a deploy from your side. This is the same lesson as our Amadeus breach breakdown on testing third-party integrations: you inherit your vendors' risk, so you need tests that watch it.

Did Content Security Policy help?

Yes, when it was strict. Report URI checked the Content Security Policy (CSP) on the sites of affected organisations it could crawl. 68 had no CSP at all. 50 had a CSP that still allowed the payload and the data theft. 17 let the script run but blocked the data theft through connect-src, though wallet swapping inside the page still worked. Only 24 blocked the payload entirely.

What separated the protected sites was a restrictive script-src that listed only the hosts they needed. Two settings let the attack through on otherwise decent policies: 'strict-dynamic', which trusts anything a trusted script inserts, and 'unsafe-eval', which allowed a fallback copy of the payload to run even where the remote script was blocked. Optimizely's own incident report also says sites with a strong CSP were protected.

What QA should test in third-party scripts

You can't control a vendor's signup flow. You can control what your pages allow and what you notice.

1. Build and maintain a script inventory

List every script that runs on your key pages: where it loads from, who owns it, and why it is there. Include scripts injected by your tag manager, not just the ones in your templates. Any script nobody can justify is a candidate for removal.

2. Test your CSP like a feature

Treat the CSP header as something with test cases. Check that it exists on every page, that script-src lists specific hosts, and that connect-src limits where the page can send data. Flag 'unsafe-inline', 'unsafe-eval' and wildcard sources for review. Turn on CSP reporting and make sure someone actually reads the reports.

3. Use Subresource Integrity where you can

Subresource Integrity (SRI) lets the browser refuse a script if its hash doesn't match what you expect. It works well for versioned libraries. Be honest about its limit: A/B testing snippets change every time someone edits an experiment, so SRI usually can't pin them. For those, rely on CSP and change monitoring instead.

4. Monitor scripts for changes

Set up alerts for three signals: a new script appearing, an existing trusted file changing, and data going to a new destination. Those are exactly the signals that would have flagged this attack.

5. Isolate the payment page

The cleanest defence is to keep third-party marketing scripts off checkout entirely. Use a hosted payment iframe where possible, and remove A/B testing and analytics tags from payment pages you aren't experimenting on. Optimizely's own report recommends removing its snippet from pages that handle payment or crypto input where you aren't running experiments. If you take card payments, PCI DSS 4.0 requirement 6.4.3 asks you to authorize, integrity-check and inventory every payment page script, and 11.6.1 asks for change and tamper detection on payment page scripts and security headers. Adyen's PCI script security guide explains both in plain terms.

6. Add checkout regression checks

Add automated checks to your checkout suite: the list of scripts on the payment page matches the approved inventory, no unexpected network calls fire when a test card is entered, and the CSP header is present and unchanged. If you sell or accept crypto, check that the wallet address shown and copied matches the one from your backend.

7. Lock down the vendor dashboard

Anyone who can edit custom code in a vendor dashboard can effectively deploy JavaScript to production. Give that right to as few people as possible, review users and API tokens regularly, and turn on two-factor authentication for every vendor account. Our guide on how to set up two-factor authentication covers the safest methods. Note that 2FA alone wouldn't have stopped a signup-flow flaw like this one, which is why the browser-side controls above still matter.

Third-party script QA checklist

  • ☐ Inventory of every script on key pages, with owner and reason
  • ☐ CSP present on all pages, with specific hosts in script-src
  • ☐ connect-src restricted to known data destinations
  • ☐ No 'unsafe-eval', 'unsafe-inline' or wildcards without a written reason
  • ☐ CSP violation reports collected and reviewed
  • ☐ SRI on versioned third-party libraries
  • ☐ Alerts for new scripts, changed scripts and new data destinations
  • ☐ No marketing, analytics or A/B scripts on payment pages unless justified
  • ☐ Card entry in a hosted payment iframe where possible
  • ☐ Checkout regression test comparing loaded scripts to the approved list
  • ☐ Least-privilege access and 2FA on every vendor dashboard
  • ☐ Logs (CDN, WAF, CSP reports) kept long enough to investigate an incident

For a wider view of where these checks fit in a normal test cycle, see our security testing guide for QA engineers. Only test sites you own or are authorized to test.

FAQ

Was Optimizely itself hacked?

Optimizely says an attacker exploited a flaw in its Web Experimentation signup flow to impersonate users on customer accounts. It says this was not a credentials breach, that no other product was affected, and that the flaw was fixed on the same day.

I visited an affected site on 16 November. What should I do?

Researchers advise updating your iPhone or iPad to the latest iOS, checking any crypto transfer you made that day, and watching your card statements if you paid on an affected site.

Would Subresource Integrity have stopped this?

Probably not for this snippet, because experimentation snippets change whenever experiments change, so a fixed hash is hard to use. A strict CSP and change monitoring were the controls that made the difference.

Short close

The Optimizely hack is a reminder that every third-party script is a production deploy you don't control. Know what runs on your pages, keep it off checkout, lock it down with CSP, and get an alert when it changes.

Comments

Popular posts from this blog

How to Check if Your Email or Password Was Leaked (and What to Do Next)

Types of Hash & Encryption

Burp Suite Tutorial for Beginners: A QA Tester's First Web App Security Test