Automatically replacing polyfill.io links with Cloudflare’s mirror for a safer Internet
Jun 26, 2024Matthew Prince, John Graham-Cumming, Michael Tremante

Summary
This post introduces an automatic JavaScript URL rewriting service that replaces links to polyfill.io with a mirror on cdnjs. This feature is enabled by default for free plan customers and available as a one-click option for paid plans. The service leverages ROFL (Response Overseer for FL), a Rust-based HTML rewriting engine, to modify script tags on the fly. The logic is bypassed if a Content Security Policy (CSP) header is present. The post also details the detection of malicious activity associated with polyfill.io using Page Shield data and IoCs.
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