DEV Community

Cover image for When a Trusted Script Becomes the Attack Surface: Inside the Optimizely Supply-Chain Incident
jamilxt
jamilxt

Posted on Edited on Originally published at jamilxt.com

When a Trusted Script Becomes the Attack Surface: Inside the Optimizely Supply-Chain Incident

A third-party script can become a direct path into a website’s visitors, even when the customer’s own application code has not changed. On November 16, malicious JavaScript was delivered through Optimizely Web experimentation snippets used by major organizations, including CNN, the BBC, Zoom, Salesforce, GitLab, IKEA and HSBC. The incident is a reminder that a website’s effective security boundary includes every external component it executes, not only the code its operators write and host.[1]

What happened

Optimizely Web lets customers run experiments by loading a JavaScript snippet from Optimizely’s content delivery network. Customers can also add “Project JavaScript” in the Optimizely dashboard, which is included in that snippet and runs on their pages. Report URI, a web security monitoring company that investigated the incident, found that an attacker had added code to customer projects. Visitors therefore received the injected code from a familiar Optimizely-hosted script, or in some cases through a customer domain that served the project’s snippet.[1]

The distinction matters. Report URI said the CDN served the content it was given and described the incident as different from CDN cache poisoning. It could not establish how the attacker obtained the ability to alter so many projects. Optimizely’s status notice later said an unauthorized party exploited a vulnerability in Experimentation to add malicious JavaScript to some customer projects. The vendor said it fixed the vulnerability, removed injected code from affected projects, secured affected accounts and added protections against unauthorized code delivery.[1][2]

Those accounts describe different parts of the evidence: the researcher’s observations of the delivered files and the vendor’s explanation of the access path. Neither source establishes that customers’ own application servers or repositories were breached. The confirmed issue was that malicious code was introduced into third-party experimentation projects and then delivered to site visitors through trusted snippets.[1][2]

What the injected code could do

Report URI identified 188 infected snippets associated with 178 organizations among 1,611 Optimizely snippets it checked. It cautioned that the true number could be higher because its review covered only snippets it found in time. This is a measured sample, not a complete census of every Optimizely customer or affected visitor.[1]

The injected script was not limited to one kind of data theft. Report URI documented cryptocurrency address replacement, payment-card skimming on eligible forms, theft of non-HttpOnly cookies and page screenshots, and iOS exploit-kit delivery. The report said hosted payment iframes, such as those used by Stripe or Adyen, were out of reach of the card-skimming component it analyzed; card data typed into a site’s own form fields was not. These details describe the observed payload and its limits, not proof that every visitor experienced every behavior.[1]

The financial impact was already measurable. Report URI traced approximately $7,040 in cryptocurrency receipts to attacker wallets as of 19:25 UTC on November 16. That figure covered the wallets and transactions it identified, not the total value of stolen data or any unobserved losses. The researchers said they could not determine how many payment cards or cookies had reached the attacker’s infrastructure.[1]

The trust problem is larger than one vendor

A browser does not treat a script as safe because a security team recognizes the company name in its URL. If a page authorizes a third-party script to execute, that script can often interact with the page and the information visitors enter there. In this case, the attackers used the trusted delivery path of an experimentation tool to put their code in front of users. That is why third-party JavaScript creates a supply-chain risk: a compromise in a service or account that sits outside a customer’s codebase can still affect the customer’s visitors.[1]

This does not mean every third-party script is too risky to use. It does mean that adding one is a security decision, not merely a marketing or analytics configuration. Teams should know which scripts run on important pages, who can modify their contents, what data those pages handle, and how a change outside the application repository would be detected. For payment pages especially, reducing direct access to card data and limiting unnecessary scripts can reduce exposure. These are defensive implications of the reported attack, not a claim that any single control would have prevented it.[1]

What organizations should take from the incident

First, inventory scripts at runtime, not just dependencies recorded in a software bill of materials. A remotely managed snippet can change without a corresponding code commit in the customer’s repository. Monitoring for unexpected script changes and outbound connections can help surface that gap; Report URI says its monitoring platform observed signals of this incident, though that is the researcher’s own account of its product.[1]

Second, treat vendor and project-account access as part of the production security boundary. The incident’s source code path was Optimizely’s project configuration, and Optimizely says it addressed a vulnerability and secured affected accounts. Organizations using the service should review vendor guidance and their own project access, while avoiding assumptions that a fix to one service automatically addresses unrelated script providers or separate implementations.[1][2]

Third, build response plans around the possibility that a trusted script is compromised. Teams need a way to identify pages loading the affected component, disable or remove it, assess what data those pages expose, and communicate with the vendor. The incident’s scale, spanning 178 organizations in Report URI’s observed set, shows why those steps should not depend on discovering a breach in each organization’s own source code first.[1]

Optimizely said it had fixed the vulnerability and removed injected code from affected projects in its November 17 status update. That is an important remediation statement, but it does not answer every customer-specific question about exposure, data access or required follow-up. Organizations that used the affected experimentation service should rely on Optimizely’s current notices and assess their own deployments and logs.[1][2]

The broader lesson is straightforward: “we did not change our code” is not enough to rule out a web compromise. The browser executes a living chain of scripts, and each trusted link in that chain can become a route to users. Security ownership has to follow that chain, including the vendors and remotely managed code that sit beyond the application repository.[1]

Sources

[1] Report URI: World’s Largest Brands Infected With Malware Via Optimizely
[2] Optimizely: Web Experimentation Security Incident

Top comments (0)