Hackers compromised Optimizely, a platform used by 178 organizations, turning trusted website scripts into malware that can steal credit card details, hijack crypto transactions, and target vulnerable iPhones and iPads.


On 16 November, visitors to webpages of BBC, Fox News, CNN, IKEA, HSBC, Starbucks, Salesforce and hundreds of other organizations may have been exposed to malicious code. The hidden script could steal cryptocurrency, skim payment-card details and deploy exploits on iPhones and iPads. The malicious code wasn’t introduced on each company’s websites individually. It was introduced via JavaScript from a company called Optimizely, which hundreds of thousands of websites use to run experiments to see whether new designs, headlines, images and features are successful.

In total, researchers from Report URI say at least 178 organizations’ websites may have been impacted by malicious JavaScript delivered via Optimizely’s Web Experimentation service. That includes websites belonging to Salesforce, GitLab, IKEA, HSBC, Equifax, Air France-KLM, Ledger and Peacock, as well as major news and tech websites.

How a trusted website tool became the entry point

Optimizely’s Web Experimentation product works by having businesses add a small piece of JavaScript to their website that loads a larger script from Optimizely’s content delivery network (CDN). Businesses can also include their own JavaScript in Optimizely via a “Project JavaScript” field, which would be executed when Optimizely’s larger script is loaded onto a website.

According to security researcher Scott Helme, who analyzed the malicious JavaScript delivered via Optimizely’s Web Experimentation service, cybercriminals introduced a small piece of JavaScript, a so-called loader, via the “Project JavaScript” field. That meant that Optimizely’s JavaScript, which is still delivered from Optimizely’s CDN and uses a valid TLS certificate, would load a second JavaScript file from a domain controlled by the attackers.

Some of these JavaScript files used Base64 encoding to hide the name of the domain that hosted the malicious JavaScript payload. Another variation included the JavaScript payload directly, meaning it could still execute even if the domain hosting the JavaScript was blocked.

Optimizely says it traced the unauthorized changes to its platform back to cybercriminals abusing a vulnerability in its Web Experimentation account signup process to impersonate users of some of its customers and modify JavaScript files within their Optimizely projects. It says that customer credentials weren’t stolen as part of this process and that no other Optimizely products were impacted.

The aftermath

According to Optimizely, once it identified that something was amiss, it took less than three hours to detect the issue, block the delivery of malicious JavaScript files, and patch the vulnerability. It also removed the malicious JavaScript files added to some customer accounts, revoked authentication tokens, invalidated active sessions, and reset access for impacted accounts. In an update on 19 November, Optimizely said fewer than 5% of its customers were impacted and that none of its services contained any more malicious JavaScript. It didn’t elaborate publicly on how the vulnerability in its account signup process could’ve been abused to access unrelated customer accounts.

Report URI says that it identified 188 unique JavaScript files impacted by this Optimizely-related software supply-chain attack, as it’s referred to in security circles, across those 178 organizations. However, it cautions that this is likely an underestimation, as it could only analyze JavaScript files it could identify.

According to Report URI, the JavaScript was modified 26 times on 16 November as new features were rolled out. For most impacted websites, Report URI says that visitors may have been at risk for around 16 hours, as the JavaScript was mostly cleaned up on the evening of 16 November and the main domain hosting the JavaScript payload was taken offline.

One script, several ways to steal

The JavaScript could scan websites for cryptocurrency wallet addresses and replace them with attacker-controlled wallet addresses, including when visitors attempted to copy and paste those addresses, for Bitcoin, Ethereum, Solana, Litecoin, Dogecoin and other cryptocurrencies. Report URI estimates that wallets controlled by the attackers received around $7,040 worth of crypto by the evening of 16 November. Another part of the JavaScript, added during the attack, could monitor forms used for online checkouts and exfiltrate payment-card details, including card numbers, expiry dates and CVVs, to the attackers.

Report URI adds that the JavaScript could also exfiltrate certain browser cookies and take screenshots of websites under certain circumstances, such as after cryptocurrency wallet addresses were modified. It notes, however, that the JavaScript couldn’t access payment-card details if they were entered into cross-origin hosted fields, used by payment processors such as Stripe and Adyen. That means that we can’t assume that anyone who attempted to make a purchase on an impacted website had their payment-card details stolen.

Coruna and DarkSword

Potentially more concerning is that the JavaScript contained code that, on iPads and iPhones, would identify the iOS version running and attempt to load one of two exploit kits, identified as Coruna and DarkSword by Helme, depending on the iOS version installed. Coruna appears to target devices running versions of iOS from 13 to 17, while DarkSword seems to be aimed at iPhones and iPads running iOS 18. There’s also a third branch that seems to perform some form of device fingerprinting on devices running iOS 26, but doesn’t appear to load the same exploit kit.

Exploit kits such as Coruna and DarkSword typically contain code that exploits known security vulnerabilities in older versions of Apple’s mobile operating system to gain unauthorized access to information stored on people’s iPhones and iPads. Apple told Reuters that the security flaws these exploit kits targeted were addressed last year and that people who keep their devices up to date would’ve been protected. Again, that doesn’t mean that everyone who visited an impacted website using an iPhone or iPad had their device compromised.

The supply-chain problem doesn’t end with Optimizely

Several organizations have temporarily disabled JavaScript from Optimizely while they investigate. What this supply-chain attack highlights, however, is the risks that organizations, and by extension their customers, take on by including third-party JavaScript on their websites for analytics, advertising, experimentation, payments and more.

That JavaScript runs in customers’ web browsers, meaning that if a company providing that JavaScript is compromised, cybercriminals could potentially target customers of hundreds of organizations without having to break into each organization’s website individually.

In case you missed:

With a background in Linux system administration, Nigel Pereira began his career with Symantec Antivirus Tech Support. He has now been a technology journalist for over 6 years and his interests lie in Cloud Computing, DevOps, AI, and enterprise technologies.

Leave A Reply

Share.
© Copyright Sify Technologies Ltd, 1998-2022. All rights reserved