Cloudflare: The Regex That Took Down the Edge
Hard · system design problem
A managed WAF rule with a catastrophic regex pins every edge CPU, and half a minute later a botnet notices. You have seconds — and the WAF cannot simply be switched off for everyone.
Inspired by Cloudflare’s July 2019 outage, when one WAF rule with a backtracking regular expression exhausted CPU on every edge server worldwide. Here: users resolve your hostname through DNS to the managed edge WAF, then the CDN and your 100,000 req/s uplink load balancer; a credential-stuffing botnet hammers the WAF’s addresses directly. At T+20s a new managed rule ships and pins 99% of the WAF’s CPUs — its health checks still pass, and it is managed, so you cannot restart or patch it. At T+50s the botnet notices and fires 180,000 login attempts per second. The WAF’s rate-limiting rules are separate from the broken managed rule and still work. The SLO counts real users over the whole incident.
Topics
More
Codelays runs in your browser: turn on JavaScript to use it.