Feature Management & Experimentation
Blog →
Feature Management & Experimentation

What the Optimizely Web Experimentation Attack Teaches Us About Feature Flag Architecture | Harness Blog

Attackers injected malicious JavaScript into Optimizely Web projects, reaching 178 organizations. Why Harness FME’s architecture avoids that path.

What the Optimizely Web Experimentation Attack Teaches Us About Feature Flag Architecture

TL;DR

  • The attack used an optional “Project JavaScript” field that runs custom code on customer pages, served from the vendor’s CDN.
  • A feature flag decision needs data (which variant), not executable code from a third party.
  • Harness FME SDKs ship inside your application and fetch flag rules as data. Nothing the service returns is executed by the browser.
  • No architecture is immune to a compromised vendor account. The question is what an attacker can reach, and in FME that is flag state, not arbitrary code in your visitors’ browsers.

On November 16, attackers put malicious JavaScript on the websites of 178 organizations, including the BBC, CNN, Zoom, Salesforce, GitLab, IKEA and HSBC. None of those sites were hacked directly. The code arrived inside a script they loaded on purpose, from a vendor they trusted: Optimizely Web Experimentation.

Report URI, the security firm that found it, reviewed 1,611 Optimizely snippets and found malicious code in 188 of them. The payload was a multi-purpose kit that included a card skimmer and a cryptocurrency address swapper. Optimizely has confirmed that an attacker exploited a vulnerability in its Experimentation account signup flow to add code to customer projects, and says the flaw is fixed. At the time of writing it had not published a full technical account.

How the attack worked

Optimizely Web works by having every page load a single JavaScript snippet from Optimizely’s CDN. That snippet contains your experiments, and it also contains an optional “Project JavaScript” field where customers can add custom code that runs on their pages. Per Report URI, the attacker added code to that field and left the rest of the snippet intact. Because the file came from the CDN the sites already trusted, every visitor received it with no action by the site owner.

The design is the exposure. A visual, no-code experimentation tool has to ship executable code to the browser, because the tool itself changes your page at runtime. Whoever can write to that project can run code on every page that loads it.

Where this design came from: experimentation grew up in marketing

Script injection is a product of who ran experiments, not an oversight. Web A/B testing grew up in marketing and growth teams in the late 2000s and early 2010s, not in engineering. The people running the tests wanted to change a headline or a button and see results that week, without filing a ticket or waiting for a release. The tools were built for them: paste one tag into the page or a tag manager, then use a visual editor to make changes that the script applies in the visitor’s browser as the page loads.

Speed and independence from engineering were the product. Resilience, code review and change control were secondary, because each one was another step between a marketer and a live test. That is also why these scripts often load synchronously at the top of the page, ahead of everything else: the goal was to apply the change before the visitor saw the original. The result is a vendor-hosted script with write access to every page that loads it.

Feature flags came from the other direction. They grew up in engineering teams practicing continuous delivery, who needed to separate deploying code from releasing it. A flag was a decision made inside the application’s own code path, written, reviewed and shipped like everything else. The difference in architecture reflects who the original customer was.

Where Harness FME is different: flag logic lives in your code, not in a script tag

Optimizely Web Experimentation loads a vendor-hosted script on every page, and that script carries the experiment logic and any custom code in the project. Harness FME has no equivalent. The code that renders each variant already exists in your application, and evaluation is done by an SDK that you install, review and ship in your own build. Harness sends that SDK data, and the architecture follows from that:

  • The SDK is part of your application. You install it as a dependency and ship it through your own pipeline. It is not a script tag that pulls the latest version of someone else’s code at page load.
  • The service returns data, not code. The SDK downloads your rollout plan (flag definitions and targeting rules) and caches it. Nothing in that payload is executed by the browser.
  • Evaluation is local. getTreatment runs in memory against that cached plan. For server-side SDKs, the browser is not involved at all.
  • There is no field that runs custom JavaScript on your pages.

So the specific path used here, writing JavaScript into a vendor project and having it served to your visitors, does not exist in FME. An attacker who got into an FME account would be changing flag state, not delivering code to your visitors’ browsers.

Harness architecture is enterprise-ready but we don’t stop there

Architecture reduces the attack surface. It does not make a vendor account uncompromisable. Flag state still matters: someone with write access could turn a feature on or off. That is why FME has role-based access control, change approvals, kill switches and audit logs that record who changed what. Two more points to be direct about:

  • With standard client-side SDKs, targeting rules are readable by anyone who inspects the client. If the rules themselves are sensitive, the thin SDK with remote evaluation keeps them in the cloud.
  • Treat dynamic configuration values as data. If your own code passes a config string to eval or injects it as HTML, you have rebuilt the problem yourself.

What to check in your own stack

  1. Inventory every third-party script that loads on your pages and who can edit what it serves.
  2. Ask each vendor whether any customer-editable field is executed in your visitors’ browsers.
  3. Use a Content Security Policy and Subresource Integrity where the vendor allows it. Report URI found that policy coverage varied widely: 17 organizations blocked the malware from sending stolen data, but crypto address replacement still worked inside their pages.
  4. Prefer SDKs that ship in your build over tags that load at runtime.

Feature flags and experiments are worth running, and they do not have to come with a remote code path into your production pages.

Sources: Report URI (Scott Helme) findings as reported by BleepingComputer, Search Engine Journal, SecurityWeek and GovInfoSecurity; Harness Developer Hub for FME SDK architecture.

← Previous:
Next: →‍

FAQs

Related Resources

Get Started

Get Started with Harness AI

Try the full platform free. No module restrictions, no credit card.

Ryan Vila
Feature Management & Experimentation - Advisory Director Americas
Ryan Vila is passionate about using analytics to drive better product development. He believes modern development organizations need stronger ways to evaluate user experience and impact at a feature level—an area often overlooked even by highly agile teams.
ryan-vila
Ryan Vila
https://www.linkedin.com/in/ryanvila/