Optimizely confirms massive cyberattack on customer websites injected stealer malware

Posted

Attackers apparently from China used an authentication security hole within the popular Optimizely AI platform for marketers to steal from at least 178 sites owned by some of the planet’s largest companies. 

Named victims featured vendors including Zoom, Paychex, Equifax, and GitLab, and end-user enterprises including Starbucks, IKEA, Mattel, American Eagle, Air France, Mutual of Omaha, Heineken, Home Chef, Cinnabon, American Eagle, Levi, Costco and HSBC.

Salesforce issued a statement confirming that it had also been impacted by the attack.

“Salesforce is investigating unauthorized modifications to scripts provided by Optimizely and used on certain Salesforce websites,” it wrote in an email statement. “As a precaution, Salesforce is confirming that Optimizely scripts are disabled across preview and production instances.”

The attacks were discovered by UK-based security researcher Scott Helme, the founder of Report URI, who said in an interview that his team had confirmed 178 victims, but that there could be more. “That’s the number that we directly observed and that all carried the same infection,” he said. 

Helme published a report about the attacks on Monday, in which he described an attack methodology where an Optimizely capability in its Web Experimentation product facilitating adding members to a site’s development team was leveraged to insert malware into the sites.

“The malware was a multi-purpose kit. It swapped cryptocurrency wallet addresses for the attacker’s, skimmed payment cards, stole cookies and screenshots, and on iPhones and iPads it delivered the Coruna and DarkSword iOS exploit kits,” Helme wrote. “The important lesson here is that trusted JavaScript doesn’t always remain trustworthy. A website can be compromised through a third-party dependency without its own code or infrastructure ever being breached.” 

Optimizely customers load a JavaScript “snippet” from Optimizely’s CDN onto their sites which contains Optimizely code, the customer’s A/B tests, and an optional field called Project JavaScript containing custom code written by the customer. The report said that attackers inserted their own code into the customer’s Project JavaScript and left the rest of each snippet untouched. “The file was still served from cdn[.]Optimizely[.]com, with Optimizely’s certificate, from a host that every affected site already trusted,” it noted.

The report described how the observed attack worked. “The script watches form submissions and every fetch/XHR POST for a card number, expiry date and CVV,” it said. “When it has all three, it sends them to https://1688360[.]cc/card[.]php with navigator.sendBeacon. Cards entered in hosted payment iframes [such as] Stripe, Adyen and similar were out of its reach. Cards typed into a site’s own form fields were not.”

Analyst questions the claims of a fix

Optimizely, which did not reply to an interview request, confirmed the attacks on its site. In an email shared with customers, Optimizely said that attackers “exploited a vulnerability in the Experimentation account signup flow. They used it to impersonate a user and add malicious JavaScript to some customer projects. We have blocked access to the vulnerable path and deployed a fix.”

The email also said that the company had “ended active sessions and revoked tokens and reset access for affected user accounts” and that it also had “removed the injected code from affected projects” and “blocked any code from being delivered in Cloudflare.”

The company used highly confident wording to describe its fix, saying that “the Optimizely Experimentation platform is fully secured” and that “modification of Javascript no longer possible.”  

Frank Dickson, principal analyst at Dickson Research, raised an eyebrow at those claims.

To begin with, he noted a discrepancy in the timelines published by the vendor and the security researcher. “Optimizely puts the first malicious write at 07:51. Report URI saw the BBC’s Optimizely snippet loading attacker code at 04:21, three and a half hours earlier,” he said. “The forensics report should reconcile that gap. Customers need the real start time to scope their exposure.”

As well, he pointed out, “Optimizely seems very comfortable stating absolutes early in a forensics investigation. Those are verdicts from a company whose forensics are still underway and whose timeline disagrees with outside research.”

No responsibility for the attack claimed

Helme speculated in an interview that the attackers were a small group of thieves, almost certainly coming from China, noting that he saw extensive Chinese writing in the code and that the attacks “tie back to infrastructure that has been used by other Chinese actors.”

“They are either Chinese or they really want us to think that they are Chinese,” Helme said, adding that the nature of what was stolen makes it highly unlikely the attackers were state actors. State actors, he said, would likely have used the malware on major news sites to create and spread false stories. 

Asked if his team could verify Optimizely’s claim that it had fixed the hole, he said that he couldn’t yet. Some of the infected sites were cleaned up, but he has to wait to see if they get reinfected before concluding that the original hole had been closed. 

Recommendation to customers ‘concerning’

Dickson said that one line in Optimizely’s email to customers was especially concerning.

“Optimizely’s documentation tells customers to allow ‘unsafe-eval‘ in their policy. At HSBC, the policy blocked the main payload and the data theft, but a backup copy of the malicious code ran anyway through that setting. A vendor’s setup guide should not quietly loosen its customers’ defenses,” Dickson said. “Restrict script-src to the hosts a page actually needs. Lock down connect-src so stolen data has nowhere to go. Drop ‘unsafe-eval‘ wherever possible. Start in report-only mode so nothing breaks.”

He added, “the Optimizely attack may be about as bad as a third-party script compromise gets. Optimizely owes its customers a clear explanation of how one flaw reached so many unrelated companies.”

This article originally appeared on CSOonline.

Cyberattacks, Cybercrime, Internet Security, Network Security, Security