HSBC Websites Hit in the Optimizely Script Attack: How a Content Security Policy Blocked the Card Skimmer but Not the Crypto Swapper

HSBC was one of the best-known names caught up in the Optimizely script attack of 16 November 2026, when malicious code was served to visitors of around 178 major websites through a widely used web testing tool. Eleven HSBC country websites appeared on the list of potentially affected sites, from the US and Hong Kong to Singapore, the UAE and Mexico. New detail on how HSBC's sites behaved during the attack shows something useful for every organisation with a website: a well-built browser security policy stopped most of the attack, and a single permissive setting let part of it through.
There is no public evidence that HSBC customers lost card details or money. HSBC said the unauthorised scripts are "not currently active" on its websites and pointed to Optimizely's statement.
What Happened
Optimizely sells a testing service that lets companies show different versions of a web page to different visitors and compare results. To do that, its customers place a small Optimizely file on their pages, which loads from Optimizely's own servers. Late on Sunday 15 November, an attacker exploited a vulnerability in the sign-up flow of Optimizely's Experimentation product and used it to add malicious JavaScript to customer projects. Optimizely's trusted delivery service then served that code to everyone who visited the affected pages.
Researchers at Report URI, led by Scott Helme, spotted the attack on Monday 16 November. They found 188 poisoned files belonging to 178 organisations, 32 of them in banking and finance. Optimizely says it fixed the flaw within about three hours of detecting the activity, removed the injected code, ended active sessions, revoked tokens and reset affected accounts. Report URI said every poisoned file it was watching was clean by 23:11 UTC that night. We covered the wider attack in our original story on 17 November.
What the Code Did
The injected code was built to make money from visitors in several ways. It skimmed card numbers, expiry dates and security codes typed into forms. It swapped cryptocurrency wallet addresses for the attacker's own, so that payments would go to the wrong place. Under some conditions it collected cookies and screenshots, and on older iPhones and iPads it tried to load exploit kits. On HSBC US, the code ran on every page that loaded the affected Optimizely file, including the homepage, Premier banking and credit card pages. Across all sites, the attacker's wallets received about $7,000.
How HSBC's Security Policy Changed the Outcome
A Content Security Policy (CSP) is a set of rules a website sends to the browser, saying which sources the page may load code from and where it may send data. It is one of the few defences that still works when a trusted supplier is the one serving bad code, because it limits what that code can do in the visitor's browser.
Report URI checked the policies of 256 affected sites belonging to 159 organisations. The results show how uneven protection is:
| What the policy did | Organisations | What it meant |
|---|---|---|
| No Content Security Policy | 68 | Nothing stopped the code from running or sending data out |
| Allowed the code and the data theft | 50 | A policy was present but did not help against this attack |
| Allowed the code but blocked data theft | 17 | The code ran, but stolen data could not leave the page |
| Blocked the code | 24 | The main payload never ran |
All 12 HSBC sites that Report URI checked fell into the best group for the main attack. Their policies blocked the primary attack file from loading and blocked data from being sent to the attacker, so the card skimmer could not get stolen details off the page. That is exactly what a good policy is for.
But the attacker had a fallback. Some poisoned Optimizely files carried an embedded backup copy of the code, so it could run even when the remote file was blocked. HSBC's policy allowed a setting called unsafe-eval, which lets scripts turn text into code and run it. That was enough for the backup copy to execute, and the crypto address swapping part of the attack ran on HSBC pages. Because HSBC does not offer cryptocurrency products, that part had nothing useful to swap.
The lesson is not that HSBC got it wrong. Its sites were among the better protected in the whole attack. The lesson is that a policy is only as strong as its most permissive setting, and attackers increasingly build in a second route for exactly that reason.
Who Is Affected
Report URI's list of potentially affected HSBC sites covers the US, Hong Kong, Mexico, Singapore, Australia, the UAE, Malaysia, Taiwan, Vietnam, Egypt and the Philippines. HSBC UK was not on it. Other organisations named in reporting include Zoom, the BBC, CNN, IKEA, Salesforce, GitLab, Equifax, ABN AMRO, Funding Circle, Ledger, Peacock and Air France-KLM.
Being on the list means a site loaded a poisoned file, not that its own systems were breached. Hudson Rock found no evidence that attackers reached the back-end systems of the sites it examined. Report URI estimates the code loaded during about 34 million page visits across all sites, with a wide range of 6 million to 150 million, but says it cannot tell how many cards, cookies or devices were actually compromised.
Why It Matters
Every modern website runs code its owner did not write. Analytics, A/B testing, chat widgets, advertising tags and consent banners all load from third parties, and each is a route for an attacker who compromises that supplier. Banks, retailers and public bodies spend heavily securing their own servers, but in this attack the servers were never touched. The visitor's browser was the target.
This is the same supplier pattern we keep seeing in Cyber News, from the Crédit Mutuel Arkéa service provider attack to the extortion campaign against card networks' marketing vendors. The difference here is that a browser-side control, the Content Security Policy, demonstrably reduced the damage for the organisations that had a strict one.
What To Do Now
List the third-party scripts on your key pages. Start with login, payment, account and form pages. For each script, note who supplies it, what it is for and whether you still need it.
Check whether you have a Content Security Policy at all. Of the organisations Report URI checked, 68 had none. Your browser's developer tools will show whether your pages send one.
Look for permissive settings. Settings such as unsafe-eval, unsafe-inline and broad wildcard sources weaken a policy. Work with your suppliers to remove them where you can, starting with sensitive pages.
Control where data can go. The connect-src and form-action rules limit where a page can send data. Getting these right is what stopped stolen card details leaving HSBC's pages, even when code ran.
Turn on reporting. A policy can report violations to an address you choose. That is how unusual script behaviour gets noticed in minutes rather than days.
Keep card entry in a separate frame. Payment fields hosted inside a payment provider's own frame were out of reach of this skimmer.
How Cybergen Can Help
Our CREST penetration testing team reviews the scripts running on web applications and tests whether a Content Security Policy holds up against injected code, and our vulnerability management service keeps watch on what your sites expose over time.
Frequently Asked Questions
Were HSBC customers' card details stolen?
There is no public evidence that they were. Researchers at Report URI found that all 12 HSBC sites they checked had a Content Security Policy that blocked the main attack file and stopped data being sent to the attacker. HSBC said the unauthorised scripts are not currently active on its websites. Nobody has published figures for cards, cookies or devices compromised on any affected site.
Which HSBC websites were affected?
Report URI's list of potentially affected sites includes HSBC in the US, Hong Kong, Mexico, Singapore, Australia, the UAE, Malaysia, Taiwan, Vietnam, Egypt and the Philippines. HSBC UK was not on the published list. These are sites that loaded a poisoned Optimizely file, not confirmed breaches of HSBC systems.
Was HSBC itself hacked?
No. The malicious code came from Optimizely, a website testing service that HSBC and around 178 other organisations use. An attacker abused a flaw in Optimizely's sign-up flow to add code to customer projects, and that code was served to visitors through Optimizely's own trusted delivery service. Hudson Rock found no evidence that the back-end systems of the sites it examined were breached.
What is unsafe-eval and why does it matter?
A Content Security Policy tells the browser which code a page may run and where it may send data. The setting 'unsafe-eval' allows scripts to turn text into code and run it. On HSBC's sites, the policy blocked the main attack file, but a backup copy of the attack code embedded in the Optimizely file could still run because 'unsafe-eval' was allowed. That let the crypto address swapping part execute, although HSBC offers no cryptocurrency products.
We do not use Optimizely. Should we still care?
Yes. Most websites load code from analytics, testing, chat, advertising and tag management providers, and any of them can be abused in the same way. The useful question is not which vendor was hit this time, but whether your own Content Security Policy would stop an injected script from running or sending data out.
Sources
- American Banker via Yahoo News: HSBC, Associated sites briefly affected by cyberattack (17 November 2026)
- Ally Security: HSBC US Optimizely website script compromise (17 November 2026)
- Newsweek: Cyber attack hits 178 major websites, full list of organisations (accessed 30 November 2026)
- Organiser: Cyber attack hits 178 sites including CNN, BBC, Zoom and HSBC (18 November 2026)
- France 24: Websites including BBC, IKEA and Air France hit by attack (17 November 2026)
