How Cloudflare’s client-side security made the npm supply chain attack a non-event

This post details the evolution of Cloudflare Page Shield's malicious script detection capabilities, specifically highlighting the use of a message-passing graph convolutional network (MPGCN) for classifying JavaScript files. It explains the preprocessing of JavaScript into Abstract Syntax Trees (ASTs) and the model's ability to learn from code structure and syntax to identify malicious intent, including obfuscation and code modification for crypto-stealing. The post quantifies model evaluation metrics (Precision, Recall, F1) and discusses improvements achieved through more training data, better training examples, and refined evaluation criteria. It also mentions the ongoing integration of contextual data and agentic AI for hybrid analysis, and the retirement of the older 'Code Behaviour Analysis' classifier. The post verifies that Page Shield would have detected the 18 compromised npm packages in the September 2025 supply chain attack.
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