On Monday malicious code ran on the websites of the BBC, CNN, Zoom, IKEA, HSBC and more than 170 other organisations. None of them were hacked. The code arrived through a script they had chosen to trust.

If your site runs Google Tag Manager, the same thing could happen to you. Here’s what went wrong, why GTM carries the same risk, and what to check this week.

What happened

Optimizely Web is an A/B testing tool. Brands add one snippet to their site, and that snippet loads from Optimizely’s own CDN on every page. Each customer project has an optional Project JavaScript field where teams can add their own code.

On 16 November, an attacker wrote malicious code into that field across 188 Optimizely snippets belonging to 178 organisations, according to Report URI’s analysis. Optimizely’s CDN then served it to every visitor, exactly as it was told to. The first injection appeared on the BBC’s snippet at 04:21 UTC. Most sites weren’t clean until late that evening.

The payload was built to make money. It swapped crypto wallet addresses for the attacker’s own, and verified transactions show funds were stolen. From the afternoon it also skimmed card numbers, expiry dates and CVVs typed into site checkout forms. It sent cookies and screenshots back to the attacker, and on older iPhones it loaded exploit kits. The attacker rebuilt the code 26 times in one day.

Nobody yet knows how the attacker got write access to so many unrelated projects. What we do know is that not one of those brands had their own code changed.

Your GTM container works the same way

Almost every brand we audit relies on a tool built on this exact model: Google Tag Manager.

GTM is a JavaScript container that loads from Google’s servers on every page of your site. Anyone with Publish rights can alter its behavior, pushing changes live to every visitor the second they click the button. There is no developer review and no release cycle. Because your security team likely allowlisted googletagmanager.com years ago, browser controls won’t block it either.

Then there is what sits inside. Most containers we inspect have accumulated years of clutter across multiple agencies and internal teams. They are filled with paused tags, abandoned campaign pixels, and undocumented Custom HTML tags. Custom HTML carries the highest risk because it executes arbitrary JavaScript, to GTM, a payment skimmer looks identical to a chat widget.

The Optimizely attacker didn’t have to breach anyone’s website directly. They only needed write access to a single trusted tool. For most brands, a GTM login is that entry point.

 

Five things to check this week

  • Check who can publish. Open Admin > User Management on every container and remove people who have left, agencies you no longer work with and any shared logins. Keep Publish rights to a small, named group, and use the Approve role so changes are reviewed before they go live.
  • Audit your Custom HTML tags. List every one and ask what it does, who added it and whether it’s still needed. Delete what nobody owns, and move the rest to Custom Templates, which run in a sandbox and must declare what they’re allowed to do. If you don’t use Custom HTML at all, block it outright with the gtm.blocklist setting in your dataLayer.
  • Set up change alerting. Turn on email notifications for container publishes and send them to someone outside the marketing team. Review the version history regularly, so a change you didn’t expect gets spotted in hours rather than weeks.
  • Deploy a Content Security Policy. A CSP tells the browser which domains a page may load scripts from and send data to. Report URI found that only 24 of the affected organisations’ sites it checked had a policy that blocked the Optimizely payload, while 68 had no CSP at all. Allowlisting your vendor’s domain isn’t enough: a tight connect-src stops stolen data leaving the page, even if a bad script gets in.
  • Move tags server-side. With a server-side GTM container, far fewer third-party scripts run in your visitors’ browsers, and you decide exactly what data each platform receives. It won’t secure your web container for you, but it shrinks what an attacker can reach.

Get your GTM container audited

We build and audit GTM setups every week, from server-side tagging to Consent Mode. Our GTM audit covers who has access, what every tag does, which tags are risky or redundant, and where a CSP or server-side setup would close the gaps. You get a clear list of what to fix first.

Optimizely’s customers didn’t choose to be breached. They chose a trusted script and didn’t watch what it was doing. Let’s make sure your tag manager isn’t the next one.

Book a GTM audit here or get in touch with us here.