~A compromise of a trusted technology provider can expose hundreds of organisations to malware, financial fraud and data theft, highlighting the need for stronger third-party risk management~

With organizations relying more and more on third-party technology providers, securing external platforms and integrations is becoming a critical part of enterprise cybersecurity. Companies use tools for website optimization, analytics and client engagement to boost efficiency and user experience.
The recent incident involving Optimizely, a popular website experimentation and A/B testing platform, illustrates this concern. Malicious code was injected using trusted website scripts, reportedly exposing visitors to several high-profile websites including BBC, CNN, HSBC, Salesforce, Zoom, IKEA and Gitlab.
Report URI security researchers say they found malicious code in 188 of the 1,611 Optimizely scripts they analyzed. These scripts were attributed to 178 organizations. The incident points out that attackers can use a trusted third-party provider to reach many organizations, without directly breaching their infrastructure. Visitors could have been exposed to financial fraud, credential theft and cryptocurrency address manipulation.
How a Trusted Website Tool Became a Security Risk?
Organizations use Optimizely to do A/B testing and change website experiences without developers having to change the underlying website code. Customers integrate the platform by adding a JavaScript snippet to their websites. When any visitor accesses the website, the browser loads the script from the infrastructure of Optimizely.
Report URI said attackers abused this trust relationship by injecting malicious JavaScript code into custom code fields of the affected Optimizely projects. Since the scripts were still served through Optimizely’s legitimate infrastructure, they looked like they were coming from a trusted source.
A Single Malicious Script, Multiple Attack Possibilities
This malicious payload, called track.js, was created to execute various tasks such as changing cryptocurrency addresses, stealing payment card information and cookies, as well as providing exploit kits targeting Apple devices. The crypto part could find Bitcoin, Ethereum, Tron and Solana wallet addresses and replace them with addresses controlled by the attacker. The payment card skimmer was used to monitor details entered in website forms, including card numbers, expiry dates and security codes, and relay the information to the attacker’s infrastructure.
The script could also collect cookies and screenshots of websites visited by the user from their web browser. Apparently, it attempted to install the Coruna and DarkSword exploit kits on Apple devices. Visitors were at risk of being infected with malware simply through visiting a compromised site. They did not have to download an untrusted file or click on a harmful link. Even if a site appears safe to visit, a compromised third party component that is active in the background can place visitors at risk for exposure to security vulnerabilities.
Why Supply Chain Attacks Are Difficult to Detect
The current incident illustrates an even greater challenge regarding cyber security – a company’s cyber security is only as strong as the technology environment that they trust. Businesses today utilize many different types of third party application interfaces (APIs), plug ins, scripts and cloud based services. Some of these integrations may provide access to confidential business processes, customer data, and/or website environments. If one of the providers is compromised, then the attacker would potentially be able to access multiple organizations. Therefore, rather than targeting individual companies, attackers could target a common technology provider that has been granted trust.
Organizations might not be aware of all the third party scripts that are currently active on their sites. Third party JavaScript components develop without any direct coordination with internal development and security teams, therefore developing a disconnect between what an organization believes is executing on its site and what a user experiences when visiting the site. According to Report URI, the malicious code was altered several times throughout the duration of the attack. It appears that the attackers have the ability to modify payload content to incorporate additional features or avoid being detected.
Why Traditional Security Controls May Not Be Enough
The incident also illustrated the importance of Content Security Policy (CSP), a browser security feature that allows users to determine which sources can run scripts and upload data. Report URI discovered that most of the organizations affected by this issue did not implement CSP at all, or their policies were insufficient to prevent the malicious activities. According to reports, only a fraction of the CSP policies tested successfully blocked the payload.
Organizations need to verify the configuration of their CSPs, limit the number of unnecessary permissions that exist within the organization and realize that third party domains which have been identified as being “trusted” do not automatically equal safe. Although organizations will still use firewalls, endpoint protection and network monitoring tools; these types of security solutions will most likely be ineffective at detecting malicious code delivered through a CSP integrated service.
What Organisations Need to Do Differently
Third-party risk management must become an integral part of enterprise cybersecurity. Security assessments should extend beyond internal applications, servers and networks to external platforms and integrations.Organisations should consider the following measures:
- Monitor third-party integrations: Maintain an inventory of scripts, plugins, APIs and external services. Review whether they are required and what level of access they have.
- Continuously monitor website scripts: Detect unauthorised modifications, suspicious code injections and unexpected communication with external domains.
- Strengthen Content Security Policies: Restrict the sources permitted to load scripts and transmit data. Avoid unnecessary permissions and enable CSP reporting.
- Review vendor access: Regularly examine user accounts, API tokens, integrations and administrative privileges. Enforce multi-factor authentication and periodic credential rotation.
- Conduct regular security assessments: Include third-party integrations in vulnerability assessments and penetration testing. Evaluate the impact of a potential vendor compromise.
- Establish incident response plans: Prepare procedures to disable affected integrations, revoke access, investigate historical activity and assess possible customer data exposure.
Moving Beyond Perimeter Security
The Optimizely incident serves as a clear warning about an important fact; organizations cannot believe that their web sites and applications are protected simply because their internal systems remain intact. As organizations connect more, the potential for attack extends past the boundaries of their control. Each external script, platform, plug-in, and service is a possible point of entry. Organizations require increased visibility, accountability, and security protections for the technology environment as well as all of its external dependencies.
Cyber security strategies will need to evolve from protecting each system individually to continuously evaluating the whole process of delivering services to customers through all technology components. Organizations will need to assess their third-party relationships continually, tighten controls over who has access, monitor in real-time, and react quickly if a trusted technology partner is attacked. Trusting a technology provider does not equate to not having to conduct security assessments. A single compromised script can cause problems well beyond the organization being targeted by the attacker.
Authored by Atul Luthra, Co-Founder & Principal Consultant, 5Tattva
