Optimizely Security Incident: What Happened and What to Do

4 min read

The Optimizely security incident is the tech story a lot of people are searching for this morning. On Monday, 16 November, an attacker used a flaw in Optimizely Web Experimentation, a popular A/B testing tool, to slip harmful code onto the websites of big brands like CNN, the BBC, Zoom, GitLab and Salesforce. If you visited one of those sites, or you use third-party scripts on your own site, here is what happened and what to do.

What happened

Optimizely confirmed early on 17 November that "an unauthorized party exploited a vulnerability in Experimentation and used it to add malicious JavaScript to some customer projects." The company says it has fixed the flaw and removed the bad code, according to SecurityWeek.

The attack was spotted by security researcher Scott Helme of Report URI. His team checked 1,611 Optimizely scripts and found 188 infected ones, belonging to 178 organizations. The bad code was put into a custom code field that runs on every page, and it was served from Optimizely's own network. So the websites loading it had no reason to distrust it.

What the bad code did

Based on reports from BleepingComputer and StepSecurity, the script did three main things:

  • Swapped crypto wallet addresses on the page and in your clipboard for the attacker's own, so a payment could go to the wrong place.
  • Grabbed card numbers, expiry dates and CVV codes typed into a site's own checkout forms.
  • Loaded extra code aimed at iPhones and iPads. Report URI linked it to known iOS exploit kits, but Hudson Rock said successful hacking of devices has not been shown.

One bit of good news: the card skimmer could not read card boxes shown inside a payment provider's own frame, like Stripe's hosted fields. Per SecurityWeek, roughly $7,000 in crypto had reached the attacker by Monday evening. StepSecurity says the attacker's main server domain was put on hold early on 17 November.

Why this matters for small businesses

You don't need to be CNN for this to hit you. Most small business websites load code from other companies: analytics, chat widgets, A/B testing, ad pixels. Each one can run anything on your pages. If one of those companies gets hacked, your site can start attacking your own customers, even though your code and server were never touched.

As Helme put it, "trusted JavaScript doesn't always remain trustworthy." SecurityWeek also reports that scripts from Kissmetrics, StorifyMe and Minute-ly were seen loading code tied to the same iOS attack, so this may not be only about Optimizely.

What to do now

If you visited an affected site on 16 November:

  • Check your card statements for charges you don't recognize, especially if you typed card details into a checkout on one of those sites.
  • If you sent crypto, check the address it went to.
  • Update your iPhone or iPad to the latest iOS.

If you run a website:

  • If you use Optimizely Web, open every project and read the Project JavaScript field. StepSecurity warns that searching for the attacker's domain alone is not enough, because one version hid it in base64.
  • List every third-party script your site loads. Remove the ones you no longer use.
  • Take card payments through a hosted payment form (like Stripe Checkout or hosted fields) instead of your own card form. That is what kept many card numbers safe this time.
  • Think about a Content Security Policy, which limits which outside domains your pages are allowed to talk to.

None of this takes long, and the last two steps protect you from the next attack like this one too. If you're not sure what scripts your site is running, that's a good question to answer this week.