CloudflareJuan Miguel CejuelaExplainer
When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts
Summary
Modern storefronts can appear healthy while malicious JavaScript diverts affiliate credit, hijacks searches or clicks, tampers with analytics, or loads further code. Cloudflare describes four operations spanning eight payloads that Page Shield ML detected in live traffic; humans verified the findings afterward, while seven payloads were absent from VirusTotal and none received a malicious verdict from URLScan. The detection system represents JavaScript as a graph with a graph neural network (GNN), sends fewer than 0.3% of analyzed scripts to a lightweight LLM on Workers AI, and uses a teacher cohort of frontier models for difficult investigations. This combination handles minification, renaming, some obfuscation, and behavior gated by device, time, geography, referrer, browser state, or cooldowns. The post concludes that continuous browser visibility and runtime context are needed because static, one-time scans can miss selectively executed attacks.
Context
The post examines four malicious JavaScript operations found on storefronts: affiliate-commission hijacking, click interception, monitoring suppression, and conditional loading of additional code. The payloads used different objectives and concealment methods, including invisible iframes, dynamic element monitoring, cooldowns, browser-state gates, and remote telemetry. Page Shield ML caught all eight payloads in live traffic, while common public scanning results were incomplete.
Approach / What changed
Page Shield ML analyzes JavaScript structurally as a graph using a graph neural network. Scripts flagged by the GNN are sent to a lightweight LLM on Workers AI for a second opinion, while a cohort of frontier-model agents investigates complex cases with restricted JavaScript evaluation. Model votes are weighted using the Artificial Analysis Intelligence Index, producing labels for benign code, payment skimming, other malware, or cryptomining; human reviewers examine malicious or inconclusive results, and the label distributions feed back into GNN training.
Takeaways
Seven of the eight payloads were absent from VirusTotal, and URLScan returned no malicious verdict for any of the eight, even though Page Shield ML detected all eight in live traffic.
The GNN analyzes JavaScript as a graph of syntax and symbol relationships, helping identify behavior across minification, renaming, and some obfuscation without depending on a known URL or byte signature.
Device, time, geography, referrer, browser-state, session, and cooldown gates can keep malicious behavior dormant during a one-time crawl, making continuous browser visibility important.
FAQ
Why can a static scanner miss these storefront payloads?
Several payloads acted only when conditions such as device, country, time, referrer, browser state, or cooldown matched. Others watched for dynamically added product elements or waited for a real click, so loading a page once and stopping could miss the attack path.
How does Page Shield ML analyze suspicious JavaScript?
Its GNN treats JavaScript as a graph rather than flat text, exposing relationships such as what calls what and what code fetches next. A lightweight LLM provides a live second opinion for the small fraction of scripts flagged by the GNN, while frontier-model agents investigate the most complex cases.
How are malicious-script labels decided?
A cohort of frontier models independently analyzes suspicious scripts, and their labels are weighted by scores from the Artificial Analysis Intelligence Index. Human reviewers examine scripts flagged as malicious or those without a clear two-thirds majority, and the resulting label distributions are fed back into GNN training.
Source and freshness
- Source
- blog.cloudflare.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.