This months OPTIMJACK attack highlighted why supply chain checks belong in every organisation’s security posture. The BBC, HSBC and CNN were among 178 organisations whose websites were affected.
Optimizely has confirmed that the attacker gained access through a flaw in its account sign-up flow, but the full root cause won’t be known until Mandiant’s investigation concludes. However, the wider impact of the flaw is becoming clearer.
The attack
Optimizely is an A/B testing service for websites, showing visitors variations of web pages to find out which works best. It allows marketing teams to change a live website without a developer release, using custom code served from Optimizely’s servers. That code runs with the same privileges as the site’s own code. Using the sign-up flaw, the Optimizely attacker inserted malicious code into customers’ projects.
While the attack was active, visitors to these sites were served code that skimmed card details, stole cookies and screenshots, swapped cryptocurrency wallet addresses and loaded exploits targeting unpatched iPhones. Optimizely has since fixed the vulnerability and removed the malicious code.
There are several lessons to be learned from these events.
Supplier criticality
Every affected site let a third party change the live code running in its visitors’ browsers. This permitted attackers a direct route in. Any supplier with that ability should be deemed a critical supplier and should be assessed/monitored accordingly.
Browser-side controls
The second is that restricting scripts to a vendor’s domain is not a robust defence. The malicious code arrived through Optimizely’s trusted infrastructure and a domain-based allow-list let it through. A strict Content Security Policy can limit the damage by controlling which scripts run and where the browser can send data, but policies accommodating such tools often allow the payload to run regardless.
Basic hygiene steps also help, with cookies being marked as HttpOnly and card details restricted from being typed anywhere except into a payment provider’s hosted fields. Monitoring the scripts a site serves and alerting on unexpected changes can shorten the time to detection.
Resilient Architecture
Another valuable lesson is that website architecture should allow a third party component to be disabled without taking down the entire website. Being able to exclude a particular third-party component quickly helped many companies switch off Optimizely across preview and production sites while they investigated. If removing a supplier’s script means significant disruption, then it may be worth revisiting the overarching design.
Ownership and governance
The last area for review is ownership. Tools like this are often bought and run by a marketing team, outside the usual change control. A platform that can push code to a live site is effectively a deployment pipeline, and should be governed as such, with named approvers and audit trails.
Key takeaways
This doesn’t mean that organisations should stop using third-party tools. Instead it is essential to know which ones can run code in your customers’ browsers, deciding how far you trust them, and making sure you can turn them off quickly when that trust is broken. Supply chain checks should reach all the way to the browser.
If you have any concerns relating to this, or any other cybersecurity issue, get in touch. We’ve put together a checklist to help organisations prevent similar attacks in future. If you would like to receive it, please email us at contact@redesmere.com.
