This runbook contains steps to harden personal devices (Kubuntu, Android, Windows, macOS) against AdFection, the spyware technique documented by Citizen Lab on October 15, 2026. AdFection is a delivery technique that uses website and app advertising networks to deploy spyware (in the documented case, Candiru’s) onto target machines upon page load.
The systems the malware exploits
AdFection exploits standard online advertisement auction processes and systems. When a webpage or mobile app has an ad slot and the page containing it loads:
- The app/page code running on the user’s device sends a request (bid) to an ad exchange
- Advertisers automatically bid for the chance to show that user an ad
- The exchange picks the winner and pushes the ad
All of this happens in under a second, hundreds of billions of times a day. Two kinds of platform sit between the parties:
- Advertisers buy through a demand-side platform (DSP)
- Sites and apps sell ad slots through a supply-side platform (SSP)
The bid carries data about the user so buyers can decide whether it’s worth their money to bid. Most data comes from SSP code embedded in the website the user visits or the SDK used to develop the mobile app, but some is supplied by the user’s mobile carrier itself:
| Data type | Data source |
|---|---|
| Mobile advertising ID | Core function of Android and iOS |
| Device details | SSP code |
| Precise location | SSP code |
| IP address | SSP code |
| Site/app containing the ad slot | SSP code |
| Ad slot specs (format, placement, price, restrictions, security flag, supported APIs, SDK used) | SSP code |
| Ad-firm cookie IDs | Ad firms’ tracking code in the browser, exchanged between firms by ID syncing |
| Page cookies | Ad’s script, reading cookies set on the page showing the ad |
| Real IP behind a VPN | Ad’s script, via WebRTC leak |
| Phone number | Mobile carriers’ “header enrichment”, frequently used for convenience (e.g. letting a site recognize a user by phone number to sign in automatically) |
A combination of this information easily allows advertisers to target a single person. And since the winning ad can include code for the target machine to execute within the ad slot, that provides the payload delivery mechanism.
An Israeli ad firm, Discover-Tech, bought ad slots that included the ability to deploy a script. On load, the script gathered information about the client machine, then sent it to the Discover-Tech server to check it against a list of targets. Non-targets saw a normal ad, while targets got code that loaded a browser exploit that installed Candiru’s spyware. Because the malware only went to chosen devices, the networks serving the ads never saw it.
The payload found in the Al Jazeera sample machine was a Windows DLL persisting via COM hijack; this lets the malware run in a process the host system classified as legitimate.
Hardening procedure
Linux desktop (Kubuntu)
- Automatic security updates: patches known bugs on the user machine;
sudo apt install unattended-upgrades && sudo dpkg-reconfigure -plow unattended-upgrades - Block ads: removes a major distribution channel; install uBlock Origin in Firefox and keep its default filter lists on
- Chrome doesn’t support full uBlock Origin, only uBlock Origin Lite (it can’t run its own filtering logic, and its main lists update only with extension updates); prefer to switch primary browsing to Firefox and use Chrome only if sites are broken
- Block third-party cookies: removes one way to target a specific device
- Firefox: Settings → Privacy & Security → Enhanced Tracking Protection → Strict
- Chrome: Settings → Privacy and security → Third-party cookies → Block third-party cookies
- Turn off JavaScript JIT: JIT speeds up page code by sacrificing security, in that browsers with it on skip interpreting every line of page code and instead convert frequently-run elements into machine code
- Firefox: browse to
about:configand setjavascript.options.ionandjavascript.options.baselinejittofalse - Chrome: browse to
chrome://settings/content/v8→ Don’t allow sites to use the V8 optimizer
- Firefox: browse to
- Stop WebRTC IP leaks
- Firefox, breaks browser video calls:
about:config→media.peerconnection.enabled=false- This closes every WebRTC leak route at once and removes WebRTC as an attack surface
- Candiru has exploited a WebRTC zero-day in Chrome before (CVE-2022-2294)
- Choose this if you don’t make video calls in the browser
- Firefox, keeps calls:
about:config→ setmedia.peerconnection.ice.default_address_only,media.peerconnection.ice.no_hostandmedia.peerconnection.ice.proxy_only_if_behind_proxytotrue- This limits which IP addresses WebRTC reveals, but the WebRTC code still runs and can still be attacked
- Chrome, keeps calls
- Install WebRTC Leak Prevent, set its IP handling policy to “Disable non-proxied UDP (force proxy)”, and tick “Allow in incognito”; OR
- Set enterprise policy
WebRtcIPHandling=disable_non_proxied_udpin a JSON file under/etc/opt/chrome/policies/managed/ - Same vulnerability as above; Chrome removed its flag for turning WebRTC off
- Firefox, breaks browser video calls:
- Configure system-wide DNS filtering: block advertising domains; set a filtering DNS resolver in
NetworkManagerfor each connection, or run a Pi-hole device on the network
Android
- Automatic updates: patches known bugs on the user machine; install system updates, and update Chrome and Android System WebView from the Play Store
- Delete the advertising ID: removes one way to target a specific device; Settings → Privacy → Ads → Delete advertising ID, which removes the ID without issuing a new one
- Older Android versions use a different path
- Configure Private DNS filtering: blocks advertising domains, including in apps; Settings → Network & internet → Private DNS → enter a filtering provider’s hostname
- Turn on Advanced Protection (Android 16): turns on Android’s most effective security features; Settings → Security & privacy → Other settings → Advanced Protection → turn on Device protection
- Turn off JavaScript JIT in Chrome: Advanced Protection already does this in Chrome; if you skip Advanced Protection, use Chrome → Settings → Privacy and security → Security → JavaScript optimization and security → turn off the V8 optimizer
- This is a Chrome setting, so ads shown inside other apps’ web views may not be covered
- Block ads and third-party cookies in a browser that supports extensions: removes a major distribution channel; install Firefox, add uBlock Origin with its default filter lists on, and set Settings → Enhanced Tracking Protection → Strict
- Chrome on Android can’t run extensions, so use Firefox as the primary browser
- Cut ad-funded apps: removes exposure to in-app ads; remove or pay for ad-free versions of ad-heavy apps
- Apps that showed these ads include MX Player and Lark Player (over one million each) and Viber (over 700,000)
Windows and macOS
Both platforms take the same Firefox and Chrome steps as Kubuntu (uBlock Origin, third-party cookie blocking, JIT off, WebRTC leak prevention). Platform-specific steps:
Windows
- Automatic updates: patches known bugs on the user machine; leave Windows Update and browser auto-update on
- Turn off the advertising ID: removes one way to target a specific device; Settings → Privacy & security → General → turn off personalized ads using your advertising ID
- Turn off JavaScript JIT in Edge (if you use Edge; Firefox and Chrome follow the Kubuntu steps): Edge → Settings → Privacy, search, and services → Security → Enhance your security on the web → Strict
- Configure system-wide DNS filtering: blocks advertising domains, including in apps; Settings → Network & internet → your connection → DNS server assignment → a filtering resolver, encrypted if offered
macOS
- Automatic updates: patches known bugs on the user machine; leave automatic updates and Background Security Improvements (the successor to Rapid Security Responses) on; check System Settings → Privacy & Security → Background Security Improvements
- Turn off personalized ads: removes one way to target a specific device; System Settings → Privacy & Security → Apple Advertising → turn off Personalized Ads
- Turn on Lockdown Mode: disables JIT JavaScript compilation in web browsing unless you exempt a site; System Settings → Privacy & Security → Lockdown Mode
- This acts on Apple’s WebKit engine, so Firefox and Chrome need their own JIT settings
- Configure system-wide DNS filtering: blocks advertising domains, including in apps; System Settings → Network → your connection → Details → DNS → a filtering resolver, encrypted if offered
Checking your work
- WebRTC
- Check: turn on your VPN and open BrowserLeaks WebRTC
- Expected result: your real public IP doesn’t appear
- Ad blocking
- Check: load a news site that normally shows ads
- Expected result: the uBlock icon shows a non-zero count and ad slots stay empty
- DNS filtering
- a. Desktop (Kubuntu, Windows, macOS)
- Check: run
nslookup mtrtb.com(a Discover-Tech domain) - Expected result: a filtering resolver that lists it returns
0.0.0.0or no answer- A normal IP means your list doesn’t cover it
- An error with no answer can also mean a failed lookup, so retry with a known good domain
- Check: run
- b. Android
- Check: open
Settings → Network & internet → Private DNS, then loadmtrtb.comin the browser - Expected result:
Private DNSshows your provider’s hostname, and the page fails to load
- Check: open
- c. Windows
- Check: open
Settings → Network & internet → your connection - Expected result:
DNS server assignmentlists your filtering resolver
- Check: open
- d. macOS
- Check: open
System Settings → Network → your connection → Details → DNS - Expected result: the
DNStab lists your filtering resolver
- Check: open
- a. Desktop (Kubuntu, Windows, macOS)
- JavaScript JIT
- a. Chrome (desktop)
- Check: browse to
chrome://settings/content/v8 - Expected result: the page lists the optimizer as disallowed
- Check: browse to
- b. Firefox (desktop)
- Check: browse to
about:configand search forjavascript.options.ionandjavascript.options.baselinejit - Expected result: both read
false
- Check: browse to
- c. Chrome (Android)
- Check: open
Chrome → Settings → Privacy and security → Security → JavaScript optimization and security - Expected result: the
V8 optimizerreadsoff
- Check: open
- d. Edge (Windows)
- Check: open
Edge → Settings → Privacy, search, and services → Security - Expected result:
Enhance your security on the webreadsStrict
- Check: open
- a. Chrome (desktop)
- Advertising ID
- a. Android
- Check: open
Settings → Privacy → Ads - Expected result: the screen shows no advertising ID
- Check: open
- b. Windows
- Check: open
Settings → Privacy & security → General - Expected result:
Personalized ads using your advertising IDreadsoff
- Check: open
- c. macOS
- Check: open
System Settings → Privacy & Security → Apple Advertising - Expected result:
Personalized Adsreadsoff
- Check: open
- a. Android
- Platform hardening mode
- a. Android Advanced Protection
- Check: open
Advanced Protection - Expected result:
Device protectionreadson
- Check: open
- b. macOS Lockdown Mode
- Check: open
System Settings → Privacy & Security → Lockdown Mode - Expected result:
Lockdown Modereadson
- Check: open
- a. Android Advanced Protection
- Automatic updates (Kubuntu)
- Check: run
systemctl status unattended-upgrades - Expected result: the service reports
active
- Check: run
Gaps left after all that work
You’ve just made it more expensive and complicated for an attack to land on your device, but your devices still aren’t bulletproof.
- Zero-day exploits still work: only if a bug is already known can an update patch it; while turning off JIT narrows the attack surface, it’s not closed since recent Chrome builds can still run WebAssembly with the V8 optimizer disallowed, depending on version and platform
- Blocklists lag behind the reality of the rotating infrastructure used by attackers: Discover-Tech moved between many domains and also used CloudFront distributions; no one can decisively block a not-previously-known domain, and pre-emptively blocking shared CDN hostnames will also break legitimate sites
- Browser controls don’t touch in-app ads: in this case, most ad bids were embedded in mobile apps
- Also complicating things: if an app uses its own encrypted DNS, this bypasses system DNS filtering
- Removing advertising IDs still leaves IP targeting possible: attackers can target a device by IP address alone, and home IP addresses tend to be persistent and stable. Worse, ads served to non-targets still sent device data back to Discover-Tech, including the public IPv6 address
- Mobile carriers leak phone numbers via header enrichment: a different attacker used Discover-Tech infrastructure to exploit header enrichment, mapping advertising IDs to carrier-issued phone numbers (this relies on plain HTTP requests); no step above stops this, and the only user-side mitigation is avoiding plain HTTP (for example with HTTPS-only mode) or using Wi-Fi instead of cellular
- Attacker can still deliver exploit via non-ad means: the Candiru attack has also succeeded via a compromised news website, not via ads; the ad-specific steps (ad blocking, DNS filtering, advertising-ID removal) don’t defend against this or against zero-click malware delivered via messengers; only the general steps (updates, JIT off, Lockdown Mode, Advanced Protection) still help
- Attacker can still build a profile without ads: Discover-Tech’s ID syncing typically happened during website visits even when the user never received a Discover-Tech ad
- Users can’t detect infection: Al Jazeera used network logs to confirm infections; users have almost no reliable way to tell an infection has happened
Sources
- Citizen Lab: Exposing AdFection (Report 195)
- The Next Web: Israeli ad firm used online ads to spread Candiru spyware
- TechCrunch: Candiru linked to Chrome zero-day
- MITRE ATT&CK: T1546.015 Component Object Model Hijacking
- CyberInsider: State spyware using ads as a distribution channel
- Risky Business: Chrome 122 V8 security setting
- Privacy Guides forum: V8 optimizer and WebAssembly
- Send.win: Firefox about:config privacy tweaks
- Send.win: WebRTC IP leak fix
- WebRTC Leak Prevent (GitHub)
- WebRTC Leak Prevent documentation
- Bushe: Blocking WebRTC in Chrome without breaking video calls
- Google: Manage Chrome safety and security
- Google: Advanced Protection for Android
- Google: Advertising ID controls
- Android Central: Advanced Protection on Pixel
- Android Police (via Yahoo Tech): Android 16 Advanced Protection mode
- Help Net Security: Apple Background Security Improvements
- The Hacker News: Apple Lockdown Mode and Rapid Security Response
- MacStories: Apple Lockdown Mode
- BrowserLeaks WebRTC test