When Trusted Website Scripts Become a Security Risk
A recent security incident shows how malicious code can reach website visitors through a trusted third-party service, even when the organisations hosting those websites have not been directly breached.

Most websites rely on external scripts to support analytics, advertising, personalisation and customer experience. These integrations are convenient because organisations can add functionality without building every component themselves.
But every external script creates another dependency. If the service behind it is compromised, the code delivered to visitors may no longer behave as expected.
That risk became clear on 16 November 2026, when security researcher Scott Helme of Report URI identified malicious JavaScript being distributed through Optimizely Web Experimentation. His investigation found 188 infected snippets belonging to 178 organisations among 1,611 snippets examined. The affected organisations included businesses across finance, technology, retail, media, travel and telecommunications. [1][2]
The attacker had inserted malicious code into the Project JavaScript field of affected customer projects. This code loaded additional scripts from an attacker-controlled domain. Because the original snippet continued to come from Optimizely's trusted domain, the activity could pass through website integrations that organisations had already approved.
The payload attempted to replace cryptocurrency wallet addresses, collect payment card details entered into website forms, steal certain browser cookies and capture screenshots. Report URI also documented attempts to deliver iOS exploit kits. It reported verified cryptocurrency transactions to attacker-controlled wallets. However, Reuters said it could not establish how many visitors were successfully affected or the full extent of the resulting compromises. [1][3]
Optimizely later confirmed that the attacker exploited a vulnerability in its account signup flow to impersonate users and modify customer projects. The company said this was not a customer password breach. It detected the activity on 16 November, fixed the vulnerability and removed the injected code from affected projects. Its investigation, supported by Mandiant, remained ongoing in its 17 November report. [2]
For organisations, the incident raises a practical question: how much visibility do security teams have over the code running in their visitors' browsers?
Traditional security monitoring often focuses on servers, endpoints and internal networks. Yet a website can deliver harmful code through a legitimate third-party integration without its own infrastructure being compromised. The browser becomes the point where the attack reaches the user.
Security teams need to understand which external scripts run on production pages, who owns each integration and what data those scripts can access. A vendor's reputation or a valid HTTPS certificate does not guarantee that every script it serves remains safe.
Content Security Policy (CSP) is one technical control that can limit the damage. A restrictive script-src directive can prevent unauthorised script sources from executing, while connect-src can restrict where browser data is sent. Report URI's analysis found that 24 of the 159 organisations whose CSP it evaluated blocked the malicious payload outright. [1]
The response also requires people with the right skills. Web developers need to understand script dependencies and secure browser policies. Security analysts need to recognise unexpected changes in JavaScript and outbound browser connections. Incident responders must be able to coordinate with vendors, preserve logs, establish exposure windows and assess whether customer notification is required.
Organisations should start by inventorying third-party scripts across production websites. They should review script changes, enforce an appropriate CSP, retain browser and web security logs and establish a clear process for disabling or investigating a compromised integration. Vendor risk reviews should include how providers control access to customer projects and notify clients about security incidents.
These responsibilities require practical knowledge across application security, threat detection and incident response. The ITSEC Cyber & AI Academy focuses on developing cybersecurity and AI capabilities that organisations need to prepare their teams for evolving threats.
Explore cybersecurity and AI learning programmes at https://www.itsec.academy/.
References
-
Report URI, “World's Largest Brands Infected With Malware Via Optimizely,” 16 November 2026. https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/
-
Optimizely, “Security Incident Initial Report for Customers – Optimizely Web Experimentation,” 17 November 2026. https://pages.optimizely.com/rs/947-RKE-048/images/Security%20Incident%20Report%20-%20Optimizely%20Web%20Experimentation%20-%20Nov%2017%202026.pdf
-
Reuters, “Popular websites compromised in bid to steal crypto, target iPhone users,” 17 November 2026. https://www.reuters.com/legal/government/popular-websites-subverted-bid-steal-crypto-target-iphone-users-2026-11-17/
.png)


