Commentary · Supply chain

The back door was left wide open

Sometimes the back door is wide open, even though you've locked the front door tight. On 16 November, 178 organisations found that out the hard way.

On Monday, 16 November, Zoom, the BBC, CNN, HSBC, Salesforce and more than 170 other organisations spent most of the day serving card skimmers, crypto stealers and iPhone exploits to anyone who visited their websites.

And not one of them got hacked, at least not in the way most people think. The malicious code came in through a tool they trusted, one they had put on their own pages themselves.

What happened

The tool was Optimizely Web, an A/B testing platform that marketing teams use to try out different versions of a web page. Someone got write access to customer projects on the platform and added their own JavaScript next to the legitimate code. Every site loading those projects then served it straight to its visitors.

Scott Helme and his team at Report URI checked 1,611 Optimizely scripts and found 188 infected, across 178 organisations. They could only check what they found in time, so the real number is almost certainly higher. BleepingComputer confirmed the code loading on Zoom, KLM, GitLab, the BBC, CNN and Salesforce, among others.

The payload was busy:

  • it swapped crypto wallet addresses, so the one you copied pointed to the attacker
  • it skimmed card details from payment forms
  • it stole cookies and screenshots
  • it loaded further code aimed at iPhones and iPads, which Helme linked to two known iOS exploit kits (not yet independently confirmed)

The BBC was serving it from 04:21 UTC. By 21:52 UTC that evening it was down to one infected script, at TalkTalk (Cyber Kendra). Optimizely says the hole was in its account signup flow and that it's been fixed (iTWire). How one attacker got into so many unrelated customer projects still hasn't been explained.

The attacker's wallets took about US$7,000 on the day. Don't let that small number fool you. Stolen cards and hijacked sessions don't show up on a blockchain.

Why this matters

I've spent more than 25 years in IT, a decade of it at a large international software development company and a good part of the rest running IT and security for an ISP. I've seen this from both the vendor's side and the customer's side, and the pattern doesn't change. We put enormous effort into the front door: patching, MFA, firewalls, monitoring. Then we hand a back door key to whoever sells us a handy marketing tool.

Every third-party script on your page runs with the same rights as your own code. It can read what your customers type, change what they see and send the data wherever it likes. Your customers can't tell your code from your vendor's, and they shouldn't have to.

These tools also tend to slip past the security process. Analytics, chat widgets, tag managers and testing platforms are often added by marketing or an agency, not IT. They rarely make it onto the vendor list that gets a proper review. Ask most organisations exactly which scripts run on their payment page today, and you'll get a long pause.

What worries me most is that most of these organisations didn't find it themselves. An outside researcher did. So the real question isn't whether you're secure. It's whether you'd even know.

And this isn't only a big-brand problem. Banks, a credit bureau, an airline and several telcos were on the list. The same kinds of tools run on plenty of South African websites too.

For leadership: five questions for your team

You don't need to read JavaScript to find out whether this is under control. Just ask:

  1. Which third-party scripts run on our customer-facing pages, and who approved each one?
  2. Who can change what they do? Think vendor accounts, agencies and API tokens, not just our own staff.
  3. If one changed overnight, how long before we'd know? Or would we read about it in the news?
  4. Are these tools on our vendor risk register, or only the systems IT bought?
  5. On pages that take payments or personal info, are we loading anything we don't actually need?

Don't forget POPIA either. If a skimmer runs on your page, it's your security compromise, even if the code came from a vendor. Section 19 puts the duty to protect personal info on you as the responsible party, and section 22 says you have to notify when it's compromised.

For technical teams: what to check

If you run Optimizely, start with Report URI's advice: review your custom project and experiment code, check which users, tokens and integrations can make changes, and rotate the credentials.

For everyone else, the same lesson applies to every third-party script you load:

  1. Know what you load. Keep an inventory of every third-party script per page, including whatever the tag manager injects. Each one needs an owner and a reason to be there.
  2. Lock down who can edit. Review the users, agencies, tokens and integrations on your tag manager and testing tools. Enforce SSO or MFA, and remove leavers.
  3. Watch the custom code boxes. That free-text field in a marketing tool is exactly where this attack landed. Treat a change there like a production code change, because it is one.
  4. Use a Content Security Policy. Limit which hosts can serve scripts and receive data. Start in report-only mode, and make sure someone actually reads the reports.
  5. Monitor what's actually served. Fetch and hash the scripts on your key pages on a schedule, and alert on any change. This time an outsider raised the alarm. You want to be first.
  6. Keep payment pages lean. Use your payment provider's hosted fields, and load nothing else you can live without.

Subresource Integrity (SRI) is great for fixed, versioned files, but it doesn't work for vendor snippets that change every time someone edits an experiment. That's why monitoring matters.

If you take card payments, PCI DSS 4.0 already expects most of this. Requirement 6.4.3 covers authorising and inventorying payment page scripts, and 11.6.1 covers detecting unauthorised changes.

Check the back door

Most security programmes are built to keep attackers out of our own systems. This one never needed to get in. It rode in on a tool that already had the keys.

Your vendor's code runs as your code, on your page, in front of your customers. When it goes wrong, it's your name in the headline. Rather find out what's running on your pages now than hear it from someone else.