Optimizely Attack: How a Trusted Script Hit 178 Websites
Attackers planted malicious JavaScript in Optimizely snippets on 178 websites. The vulnerability class, its CWE and OWASP mapping, and how to find it.
Content
Make Your Applications Secure Today
Sign up for a personalized demo to see how DerScanner can meet your Application Security needs
On November 16, 2026, attackers added malicious JavaScript to the Optimizely snippets that 178 organizations, including Zoom, the BBC, CNN, HSBC, IKEA and Ledger, load on their own websites. Visitors' browsers ran it as if it came from the site itself. Here is what happened:
- 178 organizations served the malicious code, per Report URI
- ~16 hours exposure window for most affected sites on Nov 16
- 15% of affected organizations had a browser policy that blocked the payload
What happened
Optimizely Web Experimentation lets marketing teams test changes to their pages. Each customer site loads a JavaScript snippet from cdn.optimizely.com. The snippet includes an optional Project JavaScript field that runs on every page.
According to Optimizely's status page, an unauthorized party exploited a flaw in the Web Experimentation account signup flow, impersonated users on customer accounts and inserted malicious JavaScript into their projects. Optimizely says fewer than 5% of its customers were affected and that this was not a credentials breach. Scott Helme of Report URI found the code in 188 of the 1,611 snippets his team checked, belonging to 178 organizations, and expects the real number to be higher.
| Time (UTC, 2026) | Event |
| Nov 13 | Tampered scripts from Kissmetrics, StorifyMe and Minute Media start loading an injector that Report URI links to the same attacker. |
| Nov 16, 04:21 | First malicious code seen in an Optimizely snippet, on the BBC's site. |
| Nov 16, 13:43 | A card skimmer is added to the payload. The attacker rebuilt the payload 26 times that day. |
| Nov 16, 20:40 to 21:10 | Most infected snippets are cleaned. |
| Nov 16, 23:11 | Report URI sees all infected Optimizely files clean. |
| Nov 17, 01:02 | Optimizely reports that it fixed the vulnerability and removed the injected code. |
| Nov 18, 14:49 | Optimizely names the flaw: the Web Experimentation account signup flow. |
What the injected code did
StepSecurity and Report URI analyzed the payload, a single script served to every visitor. Each part worked depending on the device and what the visitor did:
- Crypto address swapping. It replaced wallet addresses for Bitcoin, Ethereum, Solana, Tron and other networks in page text, forms and the clipboard.
- Card skimming. It captured card numbers, expiry dates and CVV codes typed into the site's own payment forms. Payment fields hosted by a separate provider in an iframe were out of reach.
- Cookie and screenshot theft. It sent cookies readable by scripts and a screenshot of the page to the attacker's server.
- iPhone and iPad exploits. On older iOS versions it loaded the Coruna and DarkSword exploit kits.
Report URI counted about $7,040 received by the attacker's wallets by the evening of November 16. CoinDesk reported that six crypto and trading firms and 32 banks and financial companies were among the affected sites.
The vulnerability class: client-side supply chain attacks
The attack needed no bug in the victims' own code. Each of them allowed a third party to run JavaScript on its pages. When the attacker changed that JavaScript at the source, every visitor's browser ran the new version with the full rights of the site. It could read forms, change page content and send data wherever the browser allowed.
This class is called a client-side, or web, supply chain attack. When the goal is payment data, it is often called web skimming or Magecart, after the criminal groups that made it common. The entry point changes from case to case. The pattern stays the same:
- Code from someone else's origin. The site loads executable code from a domain it does not control.
- Code that changes without a release. The code can change at that origin without any change to the site.
- No check and no limit. The site does not verify what it loads, and its browser policy does not restrict what that code can do.
| Case | How the trusted script changed | What it did |
| Polyfill.io, 2024 | A company bought the polyfill.io domain and its GitHub account, then served altered code from the CDN. Sansec counted more than 100,000 sites embedding it. | Redirected some mobile visitors to a betting site. |
| Kissmetrics, StorifyMe and Minute Media, 2026 | Scripts from these services loaded an injector that Report URI links to the same attacker. | Loaded the attacker's code on the sites that used them. |
| Optimizely, 2026 | A flaw in the vendor's signup flow let the attacker write into customers' Project JavaScript. | Address swapping, card skimming, cookie and screenshot theft, iOS exploits. |
For more cases of this kind, see our overview of supply chain attacks.
How OWASP and CWE classify it
The flaw in Optimizely's signup flow is a separate bug on the vendor's side, and no CVE has been published for it. On the side of the websites, the weakness is well documented:
| Entry | Name | Why it fits |
| CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | The site runs executable code from a source outside its control. |
| CWE-830 | Inclusion of Web Functionality from an Untrusted Source | The narrower web case: a widget from another domain runs inside the site's own domain. |
| CWE-494 | Download of Code Without Integrity Check | The browser downloads the snippet and runs it without checking that it is the expected version. |
| CWE-353 | Missing Support for Integrity Check | The script tag carries no integrity hash. |
| CWE-506 | Embedded Malicious Code | Describes the injected payload itself. |
| OWASP A08:2025 | Software or Data Integrity Failures | The category that maps CWE-829, CWE-830, CWE-494, CWE-353 and CWE-506. |
| OWASP A03:2025 | Software Supply Chain Failures | Covers compromises of third-party code in how software is built, distributed or updated. |
| PCI DSS 4.0 | Requirements 6.4.3 and 11.6.1 | Cover the scripts on payment pages and the detection of unauthorized changes to them. |
Why the usual defenses did not stop it
- Allowing the vendor's domain. The code came from
cdn.optimizely.com, so a Content Security Policy (CSP) that allows that domain let it through. Report URI checked the policies of the affected organizations: 68 had no CSP, 50 let the payload run and send data, 17 stopped the data theft but not the address swapping, and only 24 blocked the payload. - 'strict-dynamic' and 'unsafe-eval'. With 'strict-dynamic', any script that the trusted snippet inserts is trusted too. The payload also carried an inline copy that ran through
eval()when its own domain was blocked. Report URI notes that Optimizely's documentation asks customers to allow 'unsafe-eval', and this copy still ran on HSBC's site. - Integrity hashes. Subresource Integrity (SRI) pins a script to a known hash. It works for versioned library files. StepSecurity points out that it is hard to use for a snippet that changes every time a team publishes an experiment.
- Cookie consent banners. They decide when a script runs, not what it contains.
How to find this risk automatically
A code scan sees your code and your pages at the time of the scan. The Optimizely payload changed at the vendor after the sites were deployed. Automated defense therefore works in layers:
- Inventory every external script. Scan HTML templates and front-end code for script and link tags that load from other origins, and for code that creates script elements at runtime. Each one is a third party with write access to your pages.
- Pin what can be pinned. Add an integrity hash to static, versioned files from CDNs, and let a scanner flag the tags without one. For snippets that change on their own, self-host where you can, or restrict them as described in step 4.
- Remove eval and dynamic code. Find
eval(),new Function()and string arguments tosetTimeout()in your JavaScript, so you can drop 'unsafe-eval' from your policy. Also flag code that sends data to hard-coded external addresses. - Test the policy of the running site. Scan for a missing or weak CSP on every release: a restrictive script-src, a connect-src allowlist that blocks data exfiltration, no 'unsafe-eval', and reporting turned on. Keep payment pages free of third-party tags and use hosted payment fields in a cross-origin iframe.
- Watch for changes at runtime. Collect CSP violation reports and monitor the hash of every third-party script your pages load. A new script domain or a changed snippet on a payment page should raise an alert the same day.
- Lock down vendor accounts. Review who and what can publish code through each tag manager or testing tool, require MFA, rotate API tokens and remove unused users.
Where DerScanner helps
DerScanner checks for these weaknesses on every commit, through Git hosting webhooks or your CI/CD pipeline:
- Script tags without an integrity hash. DerScanner SAST scans HTML5, JavaScript and TypeScript code. The rule HTML5: Missing required cryptographic step flags script and link tags loaded without a hash (CWE-353), which gives you a list of unpinned external scripts to review.
- eval() and code built from data. The JavaScript and TypeScript code injection rules flag code that executes data as code (CWE-94, CWE-829, CWE-830).
- Unexpected outbound connections. The undocumented network activity rules flag code that connects to a hard-coded external server (CWE-506), which helps catch malicious code that reached your own repository.
- The policy your site actually sends. DerScanner DAST tests the running site and reports Content Security Policy findings together with the response header the server returned. Our full product demo shows such a finding.
Changes made at a vendor after your release happen outside any scan, so pair scanning with the CSP reporting and script monitoring from step 5.
If your site uses Optimizely
- Check the code. Open the Project JavaScript of every project and the custom code of every experiment. Look for
1688360.cc,atob(and any script you did not write. - Check the access. Review the users, API tokens and integrations with write access to your Optimizely account, and rotate credentials.
- Treat data as exposed. Treat cards entered on your own forms on November 16 as potentially exposed, and rotate any secrets kept in cookies that scripts can read.
- Block and search. Block the attacker domains listed by Report URI and StepSecurity, and search your logs back to 04:00 UTC on November 16.
Find risky scripts before attackers use them
Book a demo and see SAST and DAST results for your own web application. Get a demo
Sources: Optimizely status page, updates of Nov 17 and Nov 18, 2026 (status.optimizely.com); Report URI, Scott Helme, Nov 16, 2026, updated Nov 17 (blog.report-uri.com); StepSecurity, Nov 17, 2026 (stepsecurity.io); Help Net Security, Nov 17, 2026 (helpnetsecurity.com); CoinDesk, Nov 17, 2026 (coindesk.com); Sansec, Jun 25, 2024 (sansec.io); OWASP Top 10:2025; MITRE CWE; PCI Security Standards Council FAQ 1588; DerScanner vulnerability database.
Ready to Reduce Technical Debt and
Improve Security?
Clean code. Fewer risks. Stronger software

