---
id: blog/en/optimizely-third-party-javascript-csp-2026
type: blog
language: en
title: "Optimizely: what CSP stops when the third-party script is trusted"
description: A legitimate Optimizely script served hostile code. Separate loading, execution, exfiltration and the limits of a browser CSP.
summary: A legitimate Optimizely script served hostile code. Separate loading, execution, exfiltration and the limits of a browser CSP.
url: https://rootzero.eu/en/research/optimizely-third-party-javascript-csp-2026/
markdown_url: https://rootzero.eu/en/research/optimizely-third-party-javascript-csp-2026/index.md
author: rootzero
published: 2026-11-23T00:00:00.000Z
updated: 2026-11-23T00:00:00.000Z
tags:
  - Web
  - JavaScript
  - CSP
  - Third-party scripts
topics:
  - id: web-api
    name: Web and APIs
    url: https://rootzero.eu/en/research/topics/web-api/
translations:
  en: https://rootzero.eu/en/research/optimizely-third-party-javascript-csp-2026/
  fr: https://rootzero.eu/research/optimizely-javascript-csp-scripts-tiers-2026/
reading_minutes: 4
content_origin: source-analysis
research_reference: null
research_status: null
vulnerabilities: []
references:
  - label: Optimizely describes the cause and the overall 07:51–22:24 UTC exposure window
    url: https://pages.optimizely.com/rs/947-RKE-048/images/Security%20Incident%20Report%20-%20Optimizely%20Web%20Experimentation%20-%20Nov%2017%202026.pdf
  - label: Report URI found infected snippets associated with 178 organisations
    url: https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/
  - label: MDN’s directive documentation
    url: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src
sections:
  - title: From the Optimizely project to the visitor’s browser
    level: 2
    url: https://rootzero.eu/en/research/optimizely-third-party-javascript-csp-2026/#from-the-optimizely-project-to-the-visitors-browser
  - title: Four separate CSP decisions
    level: 2
    url: https://rootzero.eu/en/research/optimizely-third-party-javascript-csp-2026/#four-separate-csp-decisions
  - title: Investigating a particular site
    level: 2
    url: https://rootzero.eu/en/research/optimizely-third-party-javascript-csp-2026/#investigating-a-particular-site
---

# Optimizely: what CSP stops when the third-party script is trusted

> A legitimate Optimizely script served hostile code. Separate loading, execution, exfiltration and the limits of a browser CSP.

**Incident on 16 November 2026.** A flaw in the sign-up flow for **Optimizely Web Experimentation** let an unauthorized party impersonate administrator users and change customer project JavaScript. [Optimizely describes the cause and the overall 07:51–22:24 UTC exposure window](https://pages.optimizely.com/rs/947-RKE-048/images/Security%20Incident%20Report%20-%20Optimizely%20Web%20Experimentation%20-%20Nov%2017%202026.pdf); [Report URI found infected snippets associated with 178 organisations](https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/). The case poses a precise question: what can a Content Security Policy still block after the first file arrives from a domain the site intentionally allows?

## From the Optimizely project to the visitor’s browser

A customer page loads a snippet from `cdn.optimizely.com`. It contains platform code, the customer’s experiments and an optional project-wide JavaScript field, `projectJS`, which runs on affected pages. [Report URI shows a hostile loader added there](https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/). The browser therefore received the first stage through the provider’s familiar URL and certificate. There is no need to infer a breach of every affected organisation’s repository or web server.

The [Optimizely incident report](https://pages.optimizely.com/rs/947-RKE-048/images/Security%20Incident%20Report%20-%20Optimizely%20Web%20Experimentation%20-%20Nov%2017%202026.pdf) says the flaw allowed administrator impersonation **without stealing that user’s password**. The vendor says Web Experimentation was affected; its SDKs and Feature Experimentation were not. The overall window is a starting point for investigation. Each project’s precise window must be obtained from Optimizely. Appearance in a snippet survey does not establish that every visitor loaded an infected page or entered sensitive data.

Report URI describes three loader forms: an external URL in clear text, the same URL encoded in base64, and an embedded fallback run with `eval`. [Its payload analysis](https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/) identifies wallet substitution in the DOM and clipboard, collection of card fields and JavaScript-accessible cookies, and payloads aimed at some iOS devices. [Optimizely’s abbreviated public report](https://pages.optimizely.com/rs/947-RKE-048/images/Security%20Incident%20Report%20-%20Optimizely%20Web%20Experimentation%20-%20Nov%2017%202026.pdf) describes a narrower scope focused on cards and cryptocurrency transfers. It says payment fields entered **inside a hosted provider iframe** were beyond the page script’s reach. The sources have different observation scopes; assess effects against the page, snippet version, browser and data actually present.

## Four separate CSP decisions

A policy that allows `cdn.optimizely.com` permits the initial snippet to run. That alone says nothing about whether it can load another origin, use `eval`, send data or create an iframe. [Report URI evaluates these stages separately](https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/); [MDN’s directive documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src) explains their scope.

| Stage | Control to examine | Limit of the conclusion |
| --- | --- | --- |
| Run the initial Optimizely snippet | Does `script-src` permit it? | An allowed script can change after the site’s review. |
| Load an external second stage | Does `script-src` permit the new origin? | With `strict-dynamic`, trust in a root script can extend to scripts it inserts. |
| Run embedded fallback code | Does the policy permit `'unsafe-eval'` for code invoked through `eval`? | Blocking an external URL leaves this path open if `eval` remains allowed. |
| Send data or load a kit in a frame | Do `connect-src` and `frame-src` allow those destinations? | Blocking network egress does not undo local DOM or clipboard changes. |

**Blocking** and **observing** must remain distinct. `Content-Security-Policy-Report-Only` produces reports but does not stop an action. An enforced policy can block particular operations and needs to be checked in browsers on the actual pages. A `connect-src` violation proves a particular request was refused. It does not prove every effect of the script was neutralized.

[Report URI surveyed 256 hosts belonging to affected organisations](https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/) and classified **24 organisations** as having blocked the payload and **17** as allowing code to run while blocking the observed exfiltration destination. Address substitution inside the page could still occur in the second group. These counts describe surveyed hosts and policies, not a universal CSP success rate.

## Investigating a particular site

For a Web Experimentation customer, start with three things: pages that loaded the snippet, versions served during the project’s own exposure window, and the CSP actually enforced on those pages. Vendor change records can establish when `projectJS` changed. Web, CDN, WAF and CSP reports may show page visits and requests visible to the site. Payment or crypto transactions should be aligned with that timeline when those functions existed on exposed pages.

The origin server’s logs will not necessarily see a browser’s direct requests to an attacker-controlled domain. Conversely, a CSP report showing one blocked domain does not rule out another allowed path. [Optimizely recommends preserving logs and obtaining customer-specific timing](https://pages.optimizely.com/rs/947-RKE-048/images/Security%20Incident%20Report%20-%20Optimizely%20Web%20Experimentation%20-%20Nov%2017%202026.pdf). The vendor says it removed the injected code and closed the flaw; its 17 November document was still an initial investigation.

A personalization script is **production code that can change outside the site’s deployment process**. Its permission to load, changes in its contents and the destinations it may contact need separate controls. A restrictive CSP can reduce the effect of a hostile change, but the proof lies in tests and logs for the policy actually served.

**Primary sources:** [Optimizely incident report](https://pages.optimizely.com/rs/947-RKE-048/images/Security%20Incident%20Report%20-%20Optimizely%20Web%20Experimentation%20-%20Nov%2017%202026.pdf), [Report URI investigation and CSP analysis](https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/), [MDN `script-src` documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src).
