Documented incidentIncident 2019-07-02CloudflareEngineering postmortem

Regular expression in a WAF rule exhausts CPU on every edge server (Cloudflare, 2019)

A new WAF managed rule for XSS detection contained a regular expression that caused catastrophic backtracking and exhausted CPU.

What happened

  • The rule was deployed globally through Cloudflare's configuration system and reached all data centers within seconds.Details of the Cloudflare outage on July 2, 2019
  • The resulting outage lasted about 27 minutes.Details of the Cloudflare outage on July 2, 2019

The failure pattern

Watch the pattern: Global change without a staged rollout

Safeguards that address it

CollectSEA's engineering analysis of what would have prevented or contained this failure.

  • Deploy rules through staged rolloutsRelease new rules to a small share of traffic first and watch CPU and error rates before going global.
  • Bound rule execution costUse regex engines without catastrophic backtracking and enforce per-request CPU limits and a global kill switch.

Related standards

CollectSEA's mapping through this incident's failure pattern; not an official determination by the standards bodies.

Building something similar?

Describe your design and see every precedent that applies, with safeguards you can hand to your coding agent.

Analyze your design