When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts

This post details the evolution of Cloudflare's Client-Side Security product, specifically the Page Shield ML model, to detect sophisticated JavaScript-based attacks that evade traditional security scanners. The core technical contribution is the application of Graph Neural Networks (GNNs) to analyze JavaScript code as a graph structure, enabling detection of malicious intent based on code behavior rather than signatures. It also describes the integration of a lightweight Large Language Model (LLM) on Workers AI for a second opinion to reduce false positives and the use of a cohort of frontier models ('teachers') as agents for deeper analysis, with their disagreements treated as a signal for further training. The post provides concrete examples of four distinct malicious operations (after-hours affiliate-commission hijacker, clickless affiliate theft, old search saboteur/storefront backdoor, paid-mobile cloaker) and explains their attack chains and how they remained hidden, highlighting the importance of ongoing browser visibility and ML-driven analysis of code structure and behavior. The technical details include the use of MutationObserver for dynamic element interception, localStorage for cooldown mechanisms, and the dual-tab maneuver for affiliate commission hijacking.
More from the Website Security & Threat Management trail
- We tested our own WAF with frontier AI models. Here’s what we found
- Introducing automatic remediation policies with Cloudflare CASB
- Introducing context-aware vulnerability discovery and remediation with Cloudflare Managed Defense and OpenAI Daybreak Models
- Introducing Adaptive Intelligence: undermining the economics of every bot attack
- Say it once: introducing Bot Preference Sync