Third-Party Scripts: Lessons From the Optimizely Incident
What the Optimizely incident teaches us about third-party scripts
On November 16, visitors to websites operated by more than 170 organizations received malicious code, even though none of those sites had been compromised directly. The code arrived through Optimizely, a website experimentation platform each organization had installed.
What happened
Optimizely works by loading a lightweight script on every page of a customer's site, which lets marketers modify content and run A/B tests without a code release. That means anything Optimizely's servers deliver reaches every visitor.
An attacker exploited a vulnerability in Optimizely Web Experimentation and injected malicious JavaScript into a subset of customer projects. The affected sites then served that code to their visitors automatically.
The code targeted end users in four ways:
- Skimmed card numbers, expiration dates, and security codes from on-site checkout forms
- Exfiltrated browser cookies to an attacker-controlled server
- Replaced cryptocurrency wallet addresses to divert payments
- Attempted to deliver exploit kits to older iPhones and iPads
Optimizely reports that it has patched the vulnerability, removed the injected code, and notified affected customers, though it has not fully disclosed how the attacker gained access. The incident is unrelated to the breach Optimizely disclosed in February, in which a voice-phishing attack exposed business contact data from its internal systems.
Your site carries the same kind of exposure
Analytics platforms, ad pixels, chat widgets, and experimentation tools all run as third-party scripts with the same privileges as your site's first-party code. If any of those vendors is compromised, or an unauthorized user gains access to a login that can publish tags, your visitors are exposed while your own infrastructure remains untouched.
For most organizations, these scripts are deployed through Google Tag Manager (GTM), which makes GTM the most practical control point for inventorying and governing them.
That raises three questions worth putting to your team:
- Which third-party scripts run on our site, and where does each one send data?
- Who holds publishing rights in our tag manager, and does each of them still need that access?
- How would we detect it if a trusted vendor began serving unexpected code?
If the answer to that last question is unclear, a Content Security Policy (CSP) is a practical place to start. A CSP defines which external sources a site is permitted to load scripts from and send data to. It won't prevent every attack, but it constrains where stolen data can go and can alert your team when unauthorized code runs.
Do you know what's running on your site?
The organizations affected on November 16 didn't make an error. They relied on a trusted tool, and the attacker exploited that trust to reach their visitors. Every third-party script on your site depends on the same kind of trust.
At Red Door Interactive, our AI Prep Script Audit is a focused review that shows you what's running on your site and who can change it.
What the audit covers:
- A complete inventory of the third-party scripts running on your site and the services each one connects to
- A review of who can publish changes through your tag manager
- An assessment of the protections your site already has in place
What you receive:
- A concise, plain-language findings report you can share with your IT or security team
- Prioritized recommendations, starting with the quickest wins
- A walkthrough of the findings with our Analytics team
What comes next
If the findings point to a Content Security Policy, our team can help you put it in place and monitor it over time.
Not sure the full audit is the right fit? Start with a quick site check. Our Analytics team will confirm whether Optimizely is present and whether a security policy is already in place, then recommend next steps tailored to your environment.
Explore Related Content
Keep up-to-date on the latest marketing trends, expert insights, and helpful resources.


