Experiments

The Optimizely hack and what it means for experimentation platform security

The Optimizely hack and what it means for experimentation platform security

On November 16, attackers injected malicious Javascript into the Optimizely snippets running on some of the biggest websites in the world.

The BBC, CNN, Zoom, Salesforce, and GitLab were all reported as affected.

The code skimmed credit cards, swapped crypto wallet addresses, stole cookies, and served iOS exploit kits. Security researcher Scott Helme found it in 188 snippets across 178 organizations, and that's only the ones he was able to check. It was live for most of a day.

The worst part is that it came from Optimizely's own CDN. Browsers trusted it. So did every allowlist.

Optimizely is a competitor of ours, and I'm not writing this to gloat. An attack like this is the nightmare scenario for every feature flagging and A/B testing vendor, GrowthBook included. I want to walk through how we think about it and the architectural choices we've made to limit the damage if something goes wrong.

SOC2 is not enough

Every vendor in this space is SOC2 compliant. Optimizely is. We are too. Everyone claims to follow security best practices.

And yet attacks like this are happening more often, not less.

A SOC2 report tells you a vendor has processes. It doesn't tell you what an attacker can do when one of those processes fails. That part comes down to architecture - what exists to be compromised, and how far a single compromise can reach.

What we know about the attack

Optimizely says an attacker exploited a vulnerability in the Experimentation account signup flow and used it to add malicious Javascript to customer projects. The code went into "Project Javascript", a field meant for customers to add their own custom code to every page.

What they haven't explained is how a bug in signup gave someone write access to hundreds of existing, unrelated customer accounts. I'm not going to guess.

Instead, here are the four most likely ways I can think of to get malicious content into an SDK payload for a product like ours, and what we've done about each one.

1. The application that generates SDK payloads

This is the big one. The application is where payloads are built, so a bug here can touch everything. Based on what Optimizely has said so far, this is where their attack started.

GrowthBook is open source. The application, the SDKs, and the proxy server are all public. Anyone can read the exact code that builds and serves your payload.

That means a lot of people do. We run regular penetration tests and have an active security research team, but we also get audited by our own customers. GrowthBook is used by some of the most security-conscious companies on the planet, in industries like banking, healthcare, and AI. Their security teams don't have to take our word for anything.

Open source doesn't make code bug-free. It does mean bugs get found by more people, sooner.

2. The CDN

A lot of vendors run custom code at the edge to evaluate flags and build per-user responses. It's fast, but it's also another place where code runs, with its own deploy pipeline and its own secrets.

Our CDN is boring on purpose. It caches JSON and serves it. There are no edge workers and no custom scripts, so there's nowhere for injected code to live.

If you want remote evaluation, you run it yourself in your own infrastructure, using the same open-source proxy.

3. A compromised employee

Support tools are a favorite target. If a vendor's employees can log into customer accounts and make changes, then one phished employee is all it takes.

GrowthBook employees do not have write access to customer accounts. Even if one of us is compromised, the attacker can't modify your experiments or your SDK payloads.

4. API keys with write access

This one is on the customer's side, and it's growing fast. Coding agents need API keys. Those keys end up in config files, CI systems, and chat logs.

In GrowthBook, both Secret Keys and Personal Access Tokens can be locked down in two ways:

  • Read-only - every write is blocked
  • Human-in-the-Loop - risky changes like publishing a feature or starting an experiment are held until a person reviews and confirms them in the GrowthBook UI

With the second option, your agent can still do all of the prep work. It just can't ship anything without you. A rogue agent, or someone who steals its key, is stuck waiting for an approval that never comes.

Keys can also be set to expire and can be rotated without downtime.

Where we're not immune

No vendor can promise this will never happen to them, and I won't either.

Most of what GrowthBook serves is data, not code. A feature flag payload is JSON, and our SDKs never execute it. Someone who gets write access to your account could still flip your flags, which is bad, but they can't run a card skimmer on your checkout page.

The exception is our Visual Editor. It has a custom Javascript option, which is the same kind of feature that was abused in this attack. If you use it, your payload can contain code.

You have a few ways to shut that down:

  • Set disableJsInjection in the SDK. Experiments with custom Javascript are skipped.
  • Leave visual experiments out of your SDK payload entirely if you don't use them.
  • Don't allow unsafe-inline in your Content Security Policy. Injected scripts won't run without it.
  • Require approvals, so no single account can publish a change on its own.

That CSP point applies to every vendor. Helme found that about 15% of the affected sites had a policy strict enough to block the payload. Those sites loaded the infected snippet and nothing happened.

And if you don't want to trust us at all, you can self-host. Same code, your servers, your network.

What to do this week

Whichever vendor you use:

  • If you run Optimizely Web, check your Project Javascript for anything you didn't write. StepSecurity has the specifics.
  • List every third-party script on your site and ask what it could do if the vendor was compromised.
  • Tighten your CSP. It's the one defense that worked here without anyone having to notice the attack first.
  • Audit your API keys. Delete the ones nobody uses and make the rest read-only wherever you can.
  • Ask your vendors if their employees can make changes in your account.

Compliance reports are table stakes. The question worth asking is what happens when something breaks anyway.

If you want to see how we answer that, the code is on GitHub. Stay safe out there!

Questions about experiment security?

Talk with our experimentation team about what your SDK can run, who can publish changes, and where to put approvals.

Get in Touch
Jeremy Dorn

Jeremy Dorn

Co-Founder & CTO, GrowthBook

Table of Contents

Related articles

See All Articles
Experiments
What the recent Optimizely attack says about the software we trust
Experiments
Standing on the shoulders of giants: 13 pioneers who made A/B testing possible
How AI Visual Editing Helps Teams Run More Experiments Without Engineering
Experiments
AI
How AI Visual Editing Helps Teams Run More Experiments Without Engineering

Ready to ship faster?

No credit card required. Start with feature flags, experimentation, and product analytics — free.

Simplified white illustration of a right angle ruler or carpenter's square tool.White checkmark symbol with a scattered pixelated effect around its edges on a transparent background.