Detecting Magecart-Style attacks with Page Shield
Feb 18, 2022Oliver Cookman

Summary
This post details the technical implementation of Page Shield for detecting Magecart-style attacks. It explains how the system analyzes JavaScript Abstract Syntax Trees (ASTs) and data flow graphs to identify PII reads and exfiltration attempts. It also describes two ML models: one for 'clean' scripts and another for obfuscated scripts, differentiating between malicious and benign content. The post elaborates on techniques like analyzing data flow properties, identifying connected paths between PII reads and exfiltration calls, normalizing obfuscated content, and detecting arbitrary string transformations.
More from the Website Security & Threat Management trail
- We tested our own WAF with frontier AI models. Here’s what we found
- When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts
- 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