Sentrix

Analysis · Web security

CSP: what it blocked for Optimizely's customers

Of 159 organisations hit by the Optimizely attack, Content Security Policy blocked the code at only 24. The settings that made the difference, and the limits.

By Sentrix · Published 2026-11-17

On 16 November 2026, according to Report URI, malicious code arrived in the Optimizely snippets tied to 178 organisations. Report URI then tested the Content Security Policy, or CSP, of 159 of them against what the code needed. The result is harsh: CSP blocked the code at only 24 organisations, or 15%. The story of the incident is in our analysis of the Optimizely attack. This article is about what the settings changed.

Report URI's results

Report URI checked 4 things the code needed: load track.js from 1688360.cc, or run the inline copy, which needs 'unsafe-eval' or 'unsafe-inline'; send stolen data to 1688360.cc; load the iOS kit in a frame.

ResultOrganisations
No CSP68
CSP allowed the code and the data theft50
Code ran, but connect-src blocked the data theft17
Code blocked24

What made the difference

A short host list in script-src. The code came from a trusted domain, and allowing cdn.optimizely.com "was never going to help", Report URI writes. According to Report URI, what set the 24 protected sites apart was a script-src directive listing only the hosts they needed. It refused 1688360.cc, so track.js never loaded. To also stop the inline copy, the policy had to refuse 'unsafe-eval' as well.

No 'strict-dynamic'. This directive extends trust to any script inserted by an already approved script. The Optimizely snippet was approved, it inserted track.js, so track.js was approved too. The CSP page in Optimizely's documentation, accessed on 17 November, recommends exactly 'strict-dynamic' with a nonce on the snippet's tag. Report URI adds that Optimizely's documentation asks customers to allow 'unsafe-eval'. We did not find that on this page, With the recommended setting, track.js could therefore load. What happened next depended on the rest of the policy: the connect-src Optimizely suggests, limited to its own domains, could for example block data being sent to 1688360.cc, but not address swapping inside the page.

No 'unsafe-eval'. The attacker shipped a full copy of the code, run through eval if its domain was blocked. At HSBC, CSP blocked track.js and the data theft, but the inline copy still ran.

A restrictive connect-src. The 17 partial sites limited where the page can send data. Card, cookie and screenshot theft was blocked. Cryptocurrency address swapping, which happens inside the page, still worked.

The limits to know

CSP limits what a script can load and where it can send data. It does not check what allowed code does. Malicious code served by an allowed host that rewrites the page without sending anything still gets through. Subresource Integrity does not solve this for a dynamic snippet: according to StepSecurity, a file that changes with each experiment publish cannot be pinned to one hash.

CSP also detects. A Report-Only policy blocks nothing, but it reports loads and connections that would violate the configured policy, so any new script or data destination it does not allow. Report URI argues those signals would have revealed 1688360.cc as soon as it appeared. That comes from a vendor of such monitoring, but the principle depends on no product: the report-to directive in the W3C CSP standard sends violations to the address you choose.

Our view at Sentrix

  1. Write the CSP for the day a vendor is compromised. A short host list, no 'unsafe-eval', and a connect-src that names only the intended destinations. The convenient setting a vendor recommends is not necessarily the safe one.
  2. Start in Report-Only mode, then enforce. A few weeks of reports give a first picture of the scripts and destinations the policy would refuse, to be completed with an inventory of allowed scripts. PCI DSS requires that same inventory on payment pages, as we explain in our article on requirements 6.4.3 and 11.6.1.
  3. Treat reports as alerts. A new data destination on a login or payment page deserves the same handling as an alert in your security operations.
  4. Archive what third-party scripts contained. A timestamped copy, cross-checked with logs and reports, helps rebuild afterwards which version was served, and when.

The next step

Open the Content-Security-Policy header of your login and payment pages and look for 3 things: 'strict-dynamic', 'unsafe-eval' and a missing connect-src. Each would have let part of this attack through. If you want to review your policy with us, contact us.

Sources

Frequently asked questions

Q01
Was allowing Optimizely's domain enough?
No. The malicious code arrived inside the snippet served by cdn.optimizely.com, a domain every affected site already allowed. Report URI writes that allowing it "was never going to help". What protected the 24 sites was a script-src directive that lists only the hosts needed, and so refused the attacker's domain, 1688360.cc.
Q02
Why did 'strict-dynamic' not protect sites?
Because that directive trusts any script inserted by an already approved script. The Optimizely snippet was approved, it inserted track.js, which was then approved in turn. Yet the CSP page in Optimizely's documentation, accessed on 17 November, recommends 'strict-dynamic' with a nonce on the snippet's tag.
Q03
Would Subresource Integrity have helped?
Hardly. Subresource Integrity pins a file's hash, while the Optimizely snippet changes every time a team publishes an experiment. StepSecurity puts it this way: a file that changes with each publish cannot be pinned to one hash. Monitoring changes remains possible, blocking by hash does not.

Let's talk about your compliance program.

Last updated: