Hijacked Optimizely snippets ran malicious code on 178 sites. List every third-party script on your public site.
Attackers put malicious JavaScript into Optimizely customer snippets on November 16. What it means for public websites, and how to inventory third-party scripts and set a Content Security Policy.
The site was fine. The script was not.
On November 17, 2026, Optimizely reported that an attacker had used a vulnerability in its Web Experimentation product to add malicious JavaScript to some customer projects. Third-party reporting counts 178 organizations affected on November 16, with names such as CNN, the BBC and Zoom on the list. Optimizely says it has fixed the flaw and removed the code.
The researchers at Report URI, who tracked the incident hour by hour, wrote what matters most for anyone who runs a public website: a site can be compromised through a third-party dependency without its own code or servers ever being breached.
That should land hard with anyone responsible for a town, county, school district, college or utility website. Those sites carry the same kind of outside scripts: analytics, chat widgets, translation tools, survey forms, event calendars, embedded payment pages. Most were added by someone who has since moved on, and nobody on the current team could list them from memory.
What the attacker actually did
Optimizely customers load a JavaScript snippet from Optimizely’s content delivery network. The snippet holds Optimizely’s code, the customer’s experiments, and an optional field called Project JavaScript, where a customer can add its own code that runs on every page.
According to Report URI, the attacker wrote their own code into that field in customer projects and left the rest of each snippet alone. The file was still served from Optimizely’s domain, with Optimizely’s certificate, from a host every affected site already trusted. Nothing looked wrong to a browser or to a site owner glancing at the page.
The code was a multi-purpose kit. Report URI says it swapped cryptocurrency wallet addresses for the attacker’s, skimmed payment cards, and stole cookies and screenshots. On iPhones and iPads it delivered iOS exploit kits. Some customers serve the snippet from their own domain, and those were affected too, because the content comes from the same project.
Report URI also notes it does not know how the attacker got write access to so many unrelated customer projects. That is for Optimizely to explain. Sophos advises affected organizations to follow the vendor’s incident page for current recommendations.
We are not saying any government site was hit. The point is the shape of the risk. If your site loads code from a vendor, that vendor’s account security is part of your site’s security.
Why a hash or a certificate does not solve it
Two common answers fall short here.
A valid certificate only proves the file came from the vendor’s server. In this case it did.
Subresource Integrity pins a script to a known hash, and a browser refuses the file if it changes. MDN describes it as a way to lock an external script to its known contents at a specific point in time. That is excellent for a fixed library. It does not fit a snippet the vendor is meant to change whenever a customer edits an experiment, because the file is supposed to change.
What does help is deciding in advance which outside places your pages may load code from and send data to. That is what a Content Security Policy does. MDN describes it as a set of instructions from a site to the browser that limit what the site’s code may load, mainly JavaScript. Report URI’s view of this incident was that a policy in enforcement mode could have blocked key parts of the attack, such as the connection out to the attacker’s domain.
What to do this week
Step 1: Inventory the scripts. Open your five busiest pages, plus every page that takes money or personal information (bill pay, permits, court fines, enrollment, parent portal). In the browser’s developer tools, open the Network tab, reload, and filter by JavaScript. Write down every domain that is not yours. Then ask your web vendor for their list and compare. Expect surprises.
Step 2: Give each script an owner and a reason. One line each: what it does, who in the organization wants it, which pages it runs on. If nobody can say, remove it. Old survey tools and retired chat widgets are common finds.
Step 3: Keep outside code off the pages that handle payment or sign-in. The fewer the scripts on those pages, the smaller the damage. Hosted payment forms from your processor are a better choice than pages that mix your own forms with marketing tags.
Step 4: Ask each vendor five questions, and keep the answers with the contract file:
- Who at your company can change the code we load?
- Is multi-factor authentication required for those accounts?
- Do you log every change, and can we see it?
- How fast will you tell us about an incident, and how?
- Can we switch off custom code fields we do not use?
Step 5: Set a Content Security Policy, in report-only mode first. Report-only mode lists what would have been blocked without breaking pages. Run it for a few weeks, clean up the list, then enforce. Start with the scripts and the places the pages may send data to.
Step 6: Decide who can pull a tag in an hour. If a vendor announces an incident on a Tuesday evening, someone must be able to remove that script from the site by Wednesday morning. Write the name and the steps down. Many sites run through a tag manager or a content management system, and often only one person has the login.
How to tell it worked
- A current list of third-party scripts exists, with an owner on each line.
- Pages that take payments or sign-ins load few or none.
- The policy is in enforcement mode, and violation reports go to someone who reads them.
- A test removal of one tag, done by the named person, took under an hour.
Who does what
| Task | Department head or clerk | IT or web vendor | Elected board or district leadership |
|---|---|---|---|
| Name the business reason for each script | Yes | ||
| Run the inventory and set the policy | Yes | ||
| Ask vendors the five questions | Contract owner | Helps with the technical ones | |
| Approve the rule that outside code needs an owner | Yes | ||
| Decide when to pull a tag during an incident | Informed | Does it | Informed |
The pattern we see
In the county websites we review, the first inventory usually turns up scripts nobody can account for. A few belong to tools the county stopped paying for years ago and still run on every page. Taking those out costs nothing and shrinks the exposure before any policy is written.
This is the point where architecture meets governance. The technical fix is a policy header. The part that lasts is a rule that nothing goes onto a public page without a named owner and a reason.
Want a hand with it?
If you would like help building the inventory, setting a policy that does not break your pages, or writing the vendor questions into your next contract, we do this for public bodies of every size.
Want to talk it through? Book a free 30-minute call with Security Medic Consulting.
Sources
- Sophos X-Ops, “Hijacked Optimizely snippets served malicious code on major websites,” November 2026: sophos.com
- Report URI, “World’s Largest Brands Infected With Malware Via Optimizely,” November 16, 2026: blog.report-uri.com
- Optimizely, “Web Experimentation Security Incident,” November 2026: status.optimizely.com
- MDN, “Subresource integrity (SRI) implementation”: developer.mozilla.org
- MDN, “Content Security Policy (CSP)”: developer.mozilla.org