Why this, why now

On 2026-11-16 (UTC), malicious code was written into customer JavaScript "snippets" served by Optimizely Web, the A/B-testing platform. Visitors to at least 178 organisations' sites received malware, including Zoom, the BBC, CNN, GitLab, HSBC and IKEA. Scott Helme of Report URI published a detailed write-up, and two HN threads picked it up. The payload swapped crypto wallet addresses, skimmed cards, exfiltrated cookies and screenshots, and loaded iOS exploit kits (Coruna / DarkSword).

This piece is not about the incident timeline. It is about a CSP design decision: trusting whatever a trusted script loads, i.e. the trust propagation of 'strict-dynamic'. Report URI evaluated the CSPs of 256 affected organisations' hosts. Only 24 (15%) blocked the payload, and one of the main reasons the others didn't was 'strict-dynamic'. That keyword is the core of the "strict CSP" that web.dev recommends as the modern default. The recommended configuration turned out to be one of the attack's paths in, and that is the heart of the HN argument over "couldn't SRI have stopped this?" and "how far can CSP actually constrain this?"

The problem

Third-party scripts have three properties:

  1. The serving host is legitimate. The malicious code came from cdn.optimizely.com, under Optimizely's certificate. This was not CDN cache poisoning. The attacker wrote code into customer projects' "Project JavaScript" field, and the CDN served exactly what it was given.
  2. The content changes all the time. An Optimizely customer snippet is a dynamic file that includes experiment configuration and customer-written code. As technion put it on HN, with tools like this, the script changing is the whole point.
  3. It loads more scripts. The injected code was just a loader that used document.createElement('script') to add https://1688360.cc/track.js.

Now line up the three defensive tools:

Tool What it verifies Weakness here
Host allowlist (script-src https://cdn.optimizely.com) Where it came from The bad code came from the trusted host
SRI (integrity="sha384-...") Whether the bytes are the expected ones The bytes keep changing, so you can't pin a hash
'strict-dynamic' Whether a trusted script created it The trusted script itself was hijacked

So the real question is what you base trust on: where the code came from, what it is, or who loaded it. 'strict-dynamic' picks the third.

How it works

Why allowlists fall short, and why 'strict-dynamic' exists

A non-normative section of the CSP Level 3 spec explains the goal. 'strict-dynamic' makes CSP easier to deploy for applications that have high confidence in the scripts they load directly, but low confidence in their ability to list every resource up front. URL allowlists tend to allow bypasses via JSONP and old libraries, and exhaustive lists are brittle and hard to maintain.

When script-src contains 'strict-dynamic', two things happen (CSP3 §8.2):

The second effect is the trust propagation. Here is the spec's example:

<!-- Content-Security-Policy: script-src 'nonce-R4nd0m' 'strict-dynamic' -->
<script src="https://cdn.example.com/script.js" nonce="R4nd0m"></script>
// contents of script.js
var s = document.createElement('script');
s.src = 'https://othercdn.not-example.net/dependency.js';
document.head.appendChild(s);          // ✅ loads (not parser-inserted)

document.write('<scr' + 'ipt src="/sadness.js"></scr' + 'ipt>'); // ❌ blocked (parser-inserted)