ZeroTrace
Español

Wednesday, November 18, 2026 · 👨‍💻 Secure coding

That third-party script on your website is your code, too

Analytics, A/B testing, chat widgets, ad pixels: every line you paste into your site runs with the same permissions as your own code. What happens when that vendor gets hit, and what's enough to keep it from taking you down with it.

  • Reading time: 3 min · Deep dive: 10 min
  • 💻 Laptop
  • 🖥️ Desktop

Today's status

Heads-up

Optimizely: websites of 178 organizations served code that stole cards and attacked out-of-date iPhones

Who it affects
Anyone who visited websites using Optimizely Web on November 16, especially if they paid by card or use an iPhone or iPad on iOS 18 or earlier. Also organizations that use the platform.
What to do
Update your iPhone or iPad in Settings > General > Software Update (the latest version is iOS 27.2.1). If you paid for something online on November 16, check your card statement. If your organization uses Optimizely Web, review the Project JavaScript in each project and rotate access credentials.
Details
According to Report URI, the attacker wrote code into Optimizely customer projects, and the vendor's own CDN served it with its legitimate certificate. The code stole card data, cookies, and screenshots, swapped cryptocurrency addresses, and sent the Coruna and DarkSword exploit kits to iPhones and iPads running iOS 13 through 18; on iOS 26 it only fingerprinted the device. It's not known whether any phone was actually compromised. Optimizely told BleepingComputer, as reported by MacRumors, that a flaw in its signup process was exploited and has been fixed. Today's edition covers this in depth.

Report URI: World's largest brands infected with malware via Optimizely · Apple: Update your iPhone or iPad · MacRumors: iPhone users targeted in major website security breach

Heads-up

Chrome 158 fixes 204 flaws, six of them critical

Who it affects
Anyone using Google Chrome on Windows, Mac, Linux, or Android.
What to do
Update to Chrome 158.0.8127.36 or later (.37 also counts on Windows and Mac; on Android, 158.0.8127.42) and relaunch the browser: the update doesn't apply until you do.
Details
Google shipped the release on November 17. The six critical bugs are in WebView, GPU, Media, garbage collection, ANGLE, and WebAudio, and include use-after-free and out-of-bounds write flaws (CVE-2026-130963, CVE-2026-131031, CVE-2026-131060, CVE-2026-131008, CVE-2026-131054, and CVE-2026-130975). Google hasn't said any of them is being exploited, but with six critical flaws it's not worth waiting.
CVE-2026-130963CVE-2026-131031CVE-2026-131060CVE-2026-131008CVE-2026-131054CVE-2026-130975

Google: Stable Channel Update for Desktop, Chrome 158 (Nov 17) · Google: Chrome for Android update 158 (Nov 17)

The day's color reflects the impact on the general public. Each alert has its own color for the people it affects. See every alert we've issued.

In a nutshell

Almost every website loads code it didn't write: analytics, an A/B testing tool, a customer chat, a social media pixel. You add it by pasting one line into a template and then forget about it. But that code runs in your visitors' browsers with the same powers as your own: it can read what they type into a form, change what they see, and send data wherever it wants.

On November 16, 2026, someone managed to write malicious code into customer projects on Optimizely, a well-known A/B testing platform. According to the researcher who found it, websites belonging to 178 organizations served a script for hours that , swapped cryptocurrency addresses, and launched attacks against out-of-date iPhones. Those sites had no bug of their own: they trusted a vendor.

The answer isn't to stop using outside tools. It's to know which ones you have, remove the ones you don't need, and put limits on what the rest can do. If you own or maintain a website, even a small one, this is for you.

Real-world risk

Likelihood: medium

Attacks on a vendor are rare, but when they happen they hit thousands of sites at once. It has happened several times already: polyfill.io in 2024 and Optimizely this week.

Impact: high

Malicious code sees everything your visitors do on your page: cards, passwords, and personal data. To them, it's your site that robbed them, with all the legal and reputational fallout that comes with it.

How it works

One line that grants every permission

When you paste <script src="https://vendor.example/sdk.js"> into your page, the browser downloads that file and runs it in the same origin as your site. There's no separation: the script can read and modify the , any cookies not marked HttpOnly, whatever the user types, and the requests the page makes.

On top of that, you don't control its content. The vendor can change it at any time, and your visitors will get the new version without you deploying anything. That's the convenience they sell, and it's also the risk you take on.

Three ways someone else's script turns malicious

This is what's called a . The vendor gets breached: attackers compromise its infrastructure or code, and every customer serves whatever the attacker wants.

Your vendor account gets breached: many tools let you write custom code from their dashboard. Anyone with access to that account can inject JavaScript into your site without touching your server. That's what happened with Optimizely, where the attacker wrote their code into the Project JavaScript field of customer projects.

The domain changes hands: in February 2024, a company bought the domain and GitHub account of polyfill.io, a library that more than 100,000 sites loaded from its server. Soon after, according to Sansec, it started injecting code that redirected mobile users to sports betting sites.

What you can pin and what you can't

For files that don't change, like a specific version of a library, there's (SRI): you add the hash of the file you reviewed to the <script> tag, and if what arrives doesn't match, the browser refuses to run it. It supports SHA-256, SHA-384, and SHA-512.

The catch is that many marketing and A/B testing tools serve a snippet that changes every time you edit your project. It can't be pinned with a hash, so SRI wouldn't have stopped the Optimizely attack: the malicious file came from the legitimate server, with its legitimate certificate.

That's where a (CSP) comes in: it doesn't stop the script from changing, but it limits where more code can be loaded from and where data can be sent. Report URI, the service run by the researcher who uncovered the attack, notes that a well-tuned CSP in enforcement mode would have blocked key parts of it.

Fewer scripts is better

The cheapest measure is the most overlooked: remove what you don't use. It's common to find tags from campaigns that ended years ago or from tools nobody checks anymore.

OWASP also recommends, where possible, having the browser send events to a collector you control and letting your server forward them to the vendor. That way, third-party code never runs on the page.

What an attack looks like

  1. Access to the vendor

    The attacker gets write access to the tool: they steal an employee's password that has no two-factor protection, exploit a flaw in the vendor itself, or buy an abandoned domain that thousands of sites still load from.

  2. Silent injection

    They add a few lines to the script your pages already load. The file still comes from the usual server, with a valid certificate, and the rest of the code is unchanged: at a glance, everything looks normal.

  3. Chained loading

    Those lines load a second script from an attacker's domain, sometimes hidden in base64, and behave differently depending on the visitor: some get a payment form that's being watched, others get an attack against their phone.

  4. Collection

    As the visitor types in their card or copies a cryptocurrency address, the script captures or swaps the data and sends it to the attacker's server.

  5. Vanishing act

    Once the vendor cleans up the code, the attack leaves few traces on your server. Without CSP reports or change monitoring, you may never know what was served in your name.

What an attacker can and can't do

Can

  • Read what your visitors type into your page, including payment and sign-in forms.
  • Change what they see: account numbers, cryptocurrency addresses, or download links.
  • Steal session cookies not marked HttpOnly and take screenshots of the page.
  • Use your site as a launchpad to attack your visitors' devices.

Can't

  • Read what's typed inside a payment iframe hosted on another domain, like the payment processor's: the same-origin policy prevents it (though it could try to cover it with a fake form).
  • Run a file pinned with SRI if its content doesn't match the hash.
  • Load code from domains or send data to servers your CSP doesn't allow, if it's in enforcement mode without exceptions like 'unsafe-eval'.
  • Get into your server or your database just by controlling a browser script.

What to do

Take inventory of what your site loads

  • Impact: high
  • Effort: low
  • ⏱ 15 min
  • For: everyone

You can't protect what you don't know you have. Write down every external script, what it's for, who on your team asked for it, and who has access to its dashboard.

In the browser

  1. Open your site, press F12, and go to the Network tab.
  2. Filter by JS and reload: you'll see every script and the domain it comes from.
  3. Repeat on the checkout, sign-up, and sign-in pages, which often load different tools.

In the code

  1. Search your templates for <script src= and check your tag manager if you use one: it often loads more than what shows up in your code.

Remove what you don't need

  • Impact: high
  • Effort: low
  • ⏱ 30 min
  • For: everyone

Every script you remove is one less vendor your site's security depends on. Ask marketing and product what they actually still use.

Always

  1. Delete tags from finished campaigns and unused tools.
  2. If a tool is only needed on some pages, load it only there, and never on the checkout page unless it's essential.

Lock down your vendor accounts

  • Impact: high
  • Effort: low
  • ⏱ 10 min
  • For: everyone

If a tool lets you write code from its dashboard, whoever gets into that account gets into your site. Treat it like access to your server.

Always

  1. Turn on two-factor authentication (ideally a passkey) on every dashboard that can inject code.
  2. Review who has edit permissions and remove anyone who no longer needs them.
  3. If you use Optimizely Web, review your projects' Project JavaScript now and rotate credentials.

Self-host or pin with SRI what doesn't change

  • Impact: high
  • Effort: medium
  • ⏱ 30 min
  • For: everyone

For libraries with a fixed version (frameworks, components, icons), the simplest option is to host them on your own server. If you'd rather keep using a CDN, add the integrity attribute.

HTML

  1. Use <script src="…" integrity="sha384-…" crossorigin="anonymous">. The crossorigin attribute is required, and the external server must allow CORS.
  2. Generate the hash from the file you reviewed, not from whatever arrives later.

Deploy a CSP in report-only modeDeep-dive level

  • Impact: high
  • Effort: medium
  • ⏱ 1 h
  • For: advanced

The Content-Security-Policy-Report-Only header doesn't block anything: it just reports what would have been blocked. It shows you what your site really loads and works as an alarm if a new domain ever shows up.

Server

  1. Start with a policy that lists your domains in script-src and connect-src.
  2. Add the report-to directive: without it, no reports are sent.
  3. Review the reports for a few weeks and, once there are no surprises left, switch to Content-Security-Policy to actually block.

Isolate what your page doesn't needDeep-dive level

  • Impact: medium
  • Effort: high
  • ⏱ days
  • For: paranoid

For sites that handle payments or sensitive data: keep third-party code from running on your critical pages.

Architecture

  1. Move analytics to a server-side collector you control that forwards events to the vendor.
  2. Load widgets that don't need your page (chat, video) in an <iframe> on another domain with the sandbox attribute.
  3. On the checkout page, use the payment processor's hosted form or iframe and load nothing else.

Check it yourself

How many domains run code on your site?

In the developer tools (F12 > Network > JS filter), count the domains other than yours. If you can't explain why one is there, that's the first one to look into.

Do your external scripts use integrity?

View the page source (Ctrl+U) and search for integrity=. Version-pinned libraries from a CDN should have it; marketing snippets that change can't.

Do you have a CSP?

In F12 > Network, click the page request and check the response headers. If neither Content-Security-Policy nor Content-Security-Policy-Report-Only shows up, you have no safety net against a tampered script.

What you don't need to do

Banning every outside tool

Analytics or a chat widget add value. The sensible approach is to have few, know which they are, and limit what they can do.

Manually reviewing every version of your vendor's script

That's not feasible with snippets that change daily. That's what CSP reporting and change-monitoring tools are for.

Giving up online payments as a shopper

As a user, keeping your phone and browser updated and watching your card statements is enough. The heavy lifting belongs to whoever runs the site.

Building a perfect CSP on day one

A policy that's too strict breaks the site and ends up switched off. Better to start in report-only mode and tighten it gradually.

Myth and reality

What people think

"The script comes from a big vendor over HTTPS, so it's safe."

What actually happens

HTTPS guarantees the file arrives unaltered from the vendor's server, not that what the vendor serves is legitimate. In the Optimizely case, the malicious code came from its own CDN, with its valid certificate.

Report URI: malicious code served through Optimizely

For technical readers

CSP: domain allowlists, nonces, and 'strict-dynamic'

A CSP built only on domain allowlists is easy to bypass if you allow a large public CDN: the attacker can host their code there. Stronger policies use a random that's different in every response, or hashes of inline scripts.

Be careful with 'strict-dynamic': according to MDN, trust is propagated to every script loaded by a trusted script. If the vendor's script is trusted and someone tampers with it, whatever it loads will be trusted too. Against this kind of attack, the strong defense is a strict connect-src, which keeps data from leaving even if the code runs.

Why SRI needs CORS

To check the hash, the browser has to be able to read the response body, and for cross-origin requests that requires CORS. That's why you need crossorigin="anonymous" and the external server has to send the right headers; browsers don't allow SRI on no-cors requests.

If you list several hashes, the browser only uses the one with the strongest algorithm. That's handy for rotating versions without downtime.

What PCI DSS 4.0 requires

If your site takes cards, PCI DSS 4.0 requirements 6.4.3 and 11.6.1 have been mandatory since March 31, 2025: scripts on the payment page must be authorized, have their integrity assured, and be kept in an inventory with a written justification, and there must be a mechanism that detects changes or tampering on that page as the browser receives it.

Even if they don't apply to you, they make a good checklist for any page where users enter sensitive data.

The same problem in npm and PyPI

Your project's dependencies are the server-side version of the same risk: third-party code running with your permissions. The NSA, CISA, and ODNI guide Securing the Software Supply Chain for Developers recommends verifying third-party components, hardening the build environment, and securing how code is delivered.

Glossary

DOM
The in-memory representation of the page that the browser keeps. Whoever can modify it can change what you see and read what you type.
SRI (Subresource Integrity)
An `integrity` attribute that tells the browser the hash a file must have. If it doesn't match, the browser won't run it.
CSP (Content Security Policy)
An HTTP header a website uses to tell the browser which origins it may load code from and where it may send data.
Nonce
A one-time random value the server generates for every response and adds to its legitimate scripts so the CSP can tell them apart from the rest.
Supply chain attack
An attack that doesn't target you directly, but a vendor or component you depend on.
Web skimming
Stealing payment card data through malicious code inserted into an online store's checkout page.

Sources

  1. Report URI: malicious code served to 178 organizations through Optimizely
  2. NSA, CISA, and ODNI: Securing the Software Supply Chain for Developers
  3. OWASP: Third-Party JavaScript Management Cheat Sheet
  4. MDN: Subresource Integrity
  5. MDN: CSP script-src directive
  6. MDN: Content-Security-Policy-Report-Only header
  7. PCI SSC: PCI DSS 4.0 requirements 6.4.3 and 11.6.1 (PDF)
  8. Sansec: the polyfill.io supply chain attack
DOMThe in-memory representation of the page that the browser keeps. Whoever can modify it can change what you see and read what you type.
SRI (Subresource Integrity)An `integrity` attribute that tells the browser the hash a file must have. If it doesn't match, the browser won't run it.
CSP (Content Security Policy)An HTTP header a website uses to tell the browser which origins it may load code from and where it may send data.
NonceA one-time random value the server generates for every response and adds to its legitimate scripts so the CSP can tell them apart from the rest.
Supply chain attackAn attack that doesn't target you directly, but a vendor or component you depend on.
Web skimmingStealing payment card data through malicious code inserted into an online store's checkout page.