On 16 November 2026, visitors to the websites of 178 organisations were served malicious JavaScript. None of those organisations had their own servers breached. The code arrived inside a website testing tool they had chosen, approved and trusted. This explainer covers what happened, why perimeter controls could not see it, and the third-party script security controls that government agencies and large groups can put in place now.

What happened

The primary account is a report by security researcher Scott Helme at Report URI, published on 16 November. Optimizely Web is an experimentation platform used to run A/B tests. Each customer site loads a JavaScript snippet from Optimizely, and the snippet can carry custom code, called Project JavaScript, that runs on every page.

An attacker wrote their own code into that field across many unrelated customer projects. The modified files were served from Optimizely's own domain, with a valid certificate, from a host every affected site already allowed. Report URI checked 1,611 Optimizely snippets and found 188 infected, belonging to 178 organisations. The list includes Zoom, the BBC, CNN, Salesforce, IKEA, Equifax, Air France-KLM, Takeda and HSBC sites in several regions. The researcher expects the real number to be higher.

Optimizely said in a statement, quoted by Mashable, that an unauthorised party "exploited a vulnerability in Experimentation and used it to add malicious JavaScript to some customer projects". The company said it had fixed the vulnerability, removed the injected code, secured affected user accounts and added protections against unauthorised code being delivered. Report URI observed that every infected file was clean by 23:11 UTC the same day.

What the code did in the browser

According to the report, the payload was rebuilt 26 times during the day. It swapped cryptocurrency wallet addresses on the page and in the clipboard for the attacker's own. It captured card numbers, expiry dates and security codes typed into a site's own form fields. Cards entered into a payment provider's hosted iframe were out of its reach. It sent cookies that were not marked HttpOnly, together with screenshots of the page, to the attacker's server. On iPhones and iPads it loaded exploit kits aimed at older versions of iOS.

Keeping the scale in proportion

The visible losses were small. The researcher traced about US$7,000 in cryptocurrency to the attacker's wallets, received within roughly nine hours on 16 November. Helme is clear that this is only what the blockchain shows; nobody outside the attacker can see how many cards, cookies or devices were affected. And, as Mashable notes, malware appearing on a site does not mean every visitor to that site was exploited.

The lesson is about exposure, not damage. For most of a working day, organisations with mature security teams served an attacker's code to their own customers, from their own pages, under their own domain names. NBC Chicago reported that some affected companies said they had found no customer data affected, while others said they were still investigating.

Why a web application firewall does not see this

A web application firewall, DDoS protection and bot filtering all inspect traffic travelling towards your servers. That is the layer covered by our first guide, how government agencies and enterprises secure their websites, and by services such as the Website and government firewall. In this incident, nothing hostile came through that door.

The whole sequence ran on the visitor's device. The browser loaded a legitimate page, which told it to fetch a script from the vendor. That script then ran with the same privileges as the organisation's own code: it could read the page, read what people typed and send data anywhere the browser permitted. The organisation's servers saw neither the vendor request nor the data leaving.

Some affected customers served the Optimizely snippet from their own domain rather than the vendor's. The report says those sites were affected too, because the content still came from the same Optimizely project. A file on your own hostname is only as safe as whoever writes its contents.

That is the territory of client-side security: controls over what a browser may load, run and send while it shows your page. On most estates it is far thinner than the perimeter.

Why governments and large groups carry more of this risk

For a government agency, the pages that matter most are the ones citizens use to pay a fee, renew a licence or apply for a benefit. A script that can read those forms can read identity numbers, addresses and bank details. Even a small incident there becomes a public trust problem and, in many jurisdictions, a notifiable data breach.

For a conglomerate, the issue is scale and ownership. Each brand has its own site, marketing team and tag container. Testing and analytics tools are usually bought and run by marketing, and changes are published from a vendor dashboard, outside the release process security reviews. Ask how many third-party scripts run across a group's websites and the honest answer is often that nobody knows.

It is also not a single-vendor problem. Report URI links an earlier wave by the same actor to three other third-party scripts. Any vendor whose code runs on your pages is part of your website supply chain.

Controls that reduce your exposure

Inventory every third-party script, page by page

Build the inventory from what a browser actually loads, not from the codebase, because tag managers and vendor snippets add scripts at runtime that never appear in a repository. Crawl your main journeys with a real browser, signed in and signed out, and record each script's source, the vendor, the business owner, the pages it runs on, and who can change its contents. That last column is the one that tends to surprise people.

Tier your pages, then strip the sensitive ones

Not every page needs the same rules. Treat login, payment, citizen forms, data entry and account settings as your highest tier. Those pages should carry as few scripts as possible. A/B testing, heatmaps, session recording, chat widgets and broad tag containers rarely earn a place there. Where you take payments, prefer a payment provider's hosted fields in an iframe; in this incident, cards entered that way were out of the skimmer's reach.

Content Security Policy: report first, then enforce

A Content Security Policy is a response header that tells the browser which sources may supply scripts and frames, and where the page may send data. Start with the report-only version of the header and a reporting endpoint. Collect reports for a few weeks, build an allow-list from what you see, then enforce it on your highest-tier pages first.

Report URI's figures show why the detail matters. It evaluated the policies on 256 hosts belonging to affected organisations. Sixty-eight had no policy at all. Fifty had a policy that still allowed the payload and the data theft. Seventeen let the code run but blocked data from leaving, because their connect-src rule limited where the page could send data. Twenty-four blocked the payload outright. Allowing the vendor's domain gave no protection, because the malicious code came from that domain. What helped was a tight script-src that did not permit the attacker's host, and a connect-src that restricted outbound destinations.

Know the weak points. 'unsafe-inline' and 'unsafe-eval' let inline code and dynamically evaluated code run, and they remove much of the policy's value. In this incident one version of the attack carried an inline copy of the payload, which ran through eval on a site whose policy had blocked the external file. 'strict-dynamic' extends trust to any script a trusted script inserts, so a compromised snippet can load further scripts that inherit its trust. Many vendor tools ask you to allow these settings. If you cannot avoid them site-wide, keep them off your highest-tier pages.

Subresource Integrity, and where it stops working

Subresource Integrity lets you publish a cryptographic hash alongside a script tag. If the file changes by even one byte, the browser refuses to run it. That is ideal for versioned static files, such as a pinned release of a JavaScript library. It does not suit vendor snippets that change by design. An experimentation snippet changes each time someone edits a test, so a hash would break the page on the next legitimate update. Use integrity hashes for files that should never change, and policy plus monitoring for the ones that do.

Self-host where it is feasible

Hosting a pinned copy of a library yourself removes one party from the delivery path and puts updates under your change control. It does not help when the vendor still generates the file's contents, as the customers who served the snippet from their own domains found.

Watch what your pages actually deliver

You need to learn within hours, not at the next audit, that a script has changed or a page has started sending data somewhere new. CSP violation reports provide part of that signal. Scheduled checks with a real browser can compare the scripts and outbound connections on your highest-tier pages against an approved baseline. Helme writes that Report URI's own first signal of this incident came from report-only CSP data on a customer website.

Vendor due diligence and contract terms

Ask every script vendor two questions: who can publish code that runs on our pages, and how would we know? Then write the answers into the contract:

  • multi-factor authentication or single sign-on enforced on every account in the vendor dashboard, on both sides;
  • separate permissions for editing and for publishing, and the option to switch off custom code fields entirely;
  • an audit log of every code change, available to the customer;
  • notification of security incidents within a defined number of hours, not at the vendor's discretion;
  • advance notice of material changes to what the vendor's script collects or loads;
  • a tested route for asking the vendor to disable your project in an emergency.

Review access regularly, including API tokens and integrations. The report describes one snippet that was cleaned and then re-infected, which suggests the attacker still had access after the first clean-up.

When a vendor is compromised: a short playbook

  1. Remove or disable the vendor's tag on every page, starting with your highest tier. Do not wait for the vendor to confirm the scope.
  2. Purge cached pages and any self-hosted copies that may reference or contain the affected version.
  3. Review the vendor account: users, API tokens, integrations and custom code fields. Rotate credentials, and look for code your team did not write.
  4. Rotate session tokens and any secrets held in cookies not marked HttpOnly. Treat card details typed into your own fields during the exposure window as potentially exposed.
  5. Establish the exposure window and pages from CSP reports, monitoring and analytics.
  6. Bring in legal and privacy colleagues on notification duties, inform your payment provider and national CERT where relevant, and give users plain guidance: update devices, check statements, verify any payment addresses.
  7. Update the inventory, the page tiers and the vendor contract with what you learned.

Payment pages already have explicit rules

If you take card payments, PCI DSS v4.0 already addresses this risk directly. Requirement 6.4.3 says every script loaded and executed on a payment page in the consumer's browser must be authorised, must have its integrity assured, and must appear in an inventory with a written business or technical justification. Requirement 11.6.1 calls for a change- and tamper-detection mechanism that alerts staff to unauthorised changes to the security-impacting HTTP headers and script contents of payment pages as received by the browser, run at least weekly or at a frequency set by a targeted risk analysis. Both became mandatory on 31 March 2025.

Outside payments, the obligation is usually framed more generally. Data protection laws and public sector security frameworks expect you to control who processes personal data on your behalf. A script that can read a citizen form is processing that data, whether or not anyone signed a contract with its author.

Third-party script security checklist

ControlWhat good looks like
Script inventoryEvery third-party script listed by page, with a vendor, an owner and the people who can change it.
Page tiersLogin, payment, citizen forms and data entry identified, with testing and tag tools removed from them.
Content Security PolicyReport-only with a reporting endpoint, then enforced on top-tier pages, with tight script-src and connect-src rules.
Unsafe settingsNo 'unsafe-inline', 'unsafe-eval' or 'strict-dynamic' on top-tier pages unless documented and accepted.
Subresource IntegrityHashes on versioned static files loaded from other hosts.
Self-hostingPinned libraries served from your own infrastructure under change control.
Change monitoringAlerts within hours when a top-tier page loads a new script or sends data to a new destination.
Vendor accessMFA or SSO enforced, publishing rights limited, audit logs reviewed, tokens rotated.
ContractsBreach notification time, change notice and an emergency disable route written in.
PlaybookA rehearsed procedure to remove a tag, purge caches, rotate secrets and notify.

Frequently asked questions

  • What is a website supply chain attack?

    An attack that reaches your visitors through code you load from someone else, such as an analytics, testing, chat or advertising script. Your own servers and code can be untouched. In the Optimizely incident, malicious JavaScript was added to a trusted vendor's snippet and ran on the customers' own pages.

  • Would a web application firewall have stopped the Optimizely incident?

    No. A web application firewall inspects requests travelling to your servers. Here the visitor's browser fetched the vendor's script directly and ran it, so the malicious code never passed through the organisation's own traffic. Client-side controls such as Content Security Policy address that path.

  • Is Content Security Policy enough on its own?

    It is the strongest single browser control, but only when the policy is tight. Allowing the vendor's domain gave no protection in this case, and 'unsafe-eval' let an inline copy of the payload run. Combine a strict policy with a script inventory, page tiering, vendor access controls and change monitoring.

  • Should we stop using A/B testing and tag management tools?

    Not necessarily. Keep them off your most sensitive pages, such as login, payment and citizen forms, limit who can publish code through them, and make sure you would notice quickly if what they deliver changes.

  • How do we start with BrandPort?

    Request a briefing. BrandPort is offered by invitation. Tell us about your public websites and the third-party scripts they rely on, and we will follow up.

Request a briefing

By invitation. If you want to discuss your organisation's third-party script exposure alongside the protection of your public websites, tell us about your estate and we will follow up.

Request a briefing