Cyber security overview · 23 November 2026
How WAF protects your website
What a WAF inspects, why rate limiting cannot cap a distributed flood or a slow scan, and how Cloudflare Bot Fight Mode decides that a client is a robot.
What a WAF actually sees
A WAF is a layer 7 reverse proxy between the client and your origin, and it is not designed to defend against all types of attacks. It checks requests against rulesets that can filter on source IP, URL path, headers and body (WAF documentation). By the time a request arrives it has been parsed into HTTP — method, URI, query string, headers, cookies, body, source IP — and those fields are the whole of the evidence.
The best-known free ruleset is the OWASP Core Rule Set, an open collection for ModSecurity-compatible WAFs that does generic attack detection and calls itself one layer of defence in depth. Version 3 scores anomalies: matching rules add to a running total, and a request is blocked when it crosses a threshold. The published defaults are 5 inbound and 4 outbound, with rule scores of 5 for CRITICAL, 4 for ERROR, 3 for WARNING and 2 for NOTICE (anomaly scoring).
Cloudflare’s OWASP ruleset is built on CRS 3.3.0 and exposes threat-score thresholds of Low 60, Medium 40 (the default) and High 25 (Cloudflare OWASP ruleset). The CRS project disputes the fidelity of that implementation: its scoring page says some vendors, naming Cloudflare, set the default anomaly score well above the CRS defaults and calls that “not a proper implementation of CRS”. That is a dispute about fidelity, not a scoreboard: the two sets of numbers are not the same quantity, because the rule scores behind each threshold differ, so a higher default is not simply a looser setting.
When a rule matches, the action decides what happens: Block returns 403, rate limiting returns 429, Managed
Challenge picks a non-interactive or interactive challenge, Log records without blocking and is
Enterprise-only, and Skip is non-terminating
(actions).
Order matters. The phases run ddos_l7, custom rules, http_ratelimit, managed
rules, then http_request_sbfm, and a terminating action means the later phases
never see the request.
Where the WAF sits, and what it never sees
A WAF never sees a packet. Cloudflare’s own layer map puts WAF, Bot Management, CDN and DNS at layer 7, Spectrum and Load Balancing at layer 4, and Magic Transit at layer 3 (network layers). Layer 3 and 4 DDoS protection is a separate product matching SYN, ACK, ICMP and UDP floods (network-layer protection).
A WAF sits above those layers and sees a request that survived them, so traffic that is not HTTP gives it
nothing to judge: a SYN flood never produces a request to score. Nor does the WAF see the client, only what
the client sent. A plausible User-Agent and a valid session cookie make a request well formed
by construction.
Response headers are the browser-side layer, and a WAF does not audit them. The HTTP Security Headers tool reads those directly.
What DDoS means
The load-bearing word is distributed, not denial. NIST defines denial of service as preventing authorised access or delaying time-critical operations, and DDoS as the same thing with numerous hosts (NIST glossary). Cloudflare’s version is a flood of traffic from many compromised systems, internet-of-things devices included (what is a DDoS attack).
Volumetric attacks consume bandwidth: DNS amplification. Protocol attacks exhaust connection state: the SYN flood. Application-layer attacks exhaust per-request work: HTTP floods, HTTP/2 Rapid Reset, Slowloris, cache-busting (attack coverage).
DNS amplification shows how little the attacker needs. A spoofed source sends a UDP query — often of type ANY — to an open resolver, and the large answer goes to the victim. All amplification attacks exploit a disparity in bandwidth consumption, and the fixes are upstream: close open resolvers, filter ingress traffic.
Why rate limiting cannot cap a distributed flood
Start with the concession. Cloudflare’s Learning Center says rate limiting can help mitigate DoS and DDoS, and its documentation says advanced rate limiting can mitigate “many types of volumetric attacks” (best practices). Both hold for a narrow case: one source, or a few, hammering one endpoint, where a per-client cap is the right shape. That shape cannot bound a distributed flood.
A rate limiting rule is an expression, an action, characteristics, a period, a request count and a
mitigation duration
(rate limiting rules).
Cloudflare keeps a separate counter per unique combination of characteristic values, and states that it
“does not support global rate limiting counters across the entire network. Each data center maintains its
own counters.” Every rule also carries cf.colo.id as a hidden mandatory characteristic
(request rate).
The allowance is not the number you typed. It is roughly the threshold, times the distinct characteristic values, times the number of data centres. A rule of 100 requests per minute per IP does not mean your site receives 100 per minute: with N source addresses it permits 100·N per minute, and each data centre counts separately, so the network-wide ceiling is higher still. The one quantity you control is the per-counter threshold.
Counters lag “up to a few seconds”, so excess requests can reach your origin before mitigation applies. Spoofing does not rescue the arithmetic either: a spoofed source cannot complete a TCP handshake, so it distorts packet-layer and UDP accounting, not layer 7 request floods, which need addresses that can finish the handshake.
Plan limits decide what you can express: Free allows one rule, a 10-second period and IP only; Pro two rules, up to a minute; Business five rules, up to ten minutes, with IP and NAT support; Enterprise 100 rules, up to 65,535 seconds. Counting by session cookie or JA3 fingerprint — Cloudflare’s advice for “a bot network performing a distributed attack” — presumes characteristics the lower plans do not offer.
Legitimate bursts collide with the limit by design, and challenging verified bots can hurt search indexing. Cloudflare calls rate limiting “not a complete solution for managing bot activity”, “fairly one dimensional”, and says it doesn’t distinguish between good bots and bad bots.
The distributed case is handled instead by the always-on layer 7 managed ruleset in ddos_l7,
which runs before custom rules and reacts to origin health — a default of 1,000 errors per second, with Pro
and above requiring at least five times normal
(HTTP DDoS managed ruleset).
Behind it, anycast spreads attack traffic, so if network capacity exceeds attack volume the attack is
mitigated.
That depends on capacity, not on a clever rule.
Why slow scanning slips under it too
A low and slow attack sends a small stream of very slow traffic, using little bandwidth and resembling an ordinary client. Cloudflare states the consequence plainly: “The rate detection techniques used to identify and stop traditional DDoS attacks will not pick up on a low and slow attack” (low and slow attacks). Its named tools are Slowloris (partial headers), R.U.D.Y. (dribbled body) and Sockstress (abusing the TCP handshake).
Slowloris holds many simultaneous partial connections just under the server timeout so request threads are never freed — one machine, low bandwidth. Its documented mitigations are connection limits, restricting slow transfer speeds, limiting connection duration and a buffering reverse proxy; none is a request-rate limit. Cloudflare buffers at the edge, so Slowloris traffic never reaches the origin. A rate limiting rule has four quantitative knobs and no connection-count, duration or transfer-speed parameter, so it counts the wrong quantity.
Distribution finishes the job: 500 addresses sending 100 requests an hour stays under any sane threshold, so no single counter trips and the aggregate is the attack. Keying by fingerprint or session instead is gated to Enterprise or Advanced rate limiting, and on Free the only characteristic is IP, so distributed-scan defence is structurally unavailable on that plan.
How Cloudflare Bot Fight Mode decides you are a robot
Bot Fight Mode is the free version of that judgement. It detects known bot patterns, issues “computationally expensive challenges that force the requesting client to perform CPU-intensive calculations”, and notifies Bandwidth Alliance partners (Bot Fight Mode). On Free plans it detects “simple bots from cloud hosting providers and headless browsers”, applies the computational challenge, and works domain-wide (free plans).
Three engines are documented. Heuristics run on all requests against a growing database of malicious fingerprints, scoring a high-confidence match 1, occasionally 29. A supervised machine learning model “accounts for the majority of all bot detections”, consuming request features, headers, session characteristics and browser signals, and outputs a probability that the visitor is human, mapped to 1–99. JavaScript Detections injects invisible JavaScript to identify headless browsers; it is auto-enabled for Bot Fight Mode and cannot be disabled (bot detection engines). The bands are 1 automated, 2–29 likely automated, 30–99 likely human, and 0 not computed; granular scores are Enterprise only.
Verified bots need both honest self-identification — a Web Bot Auth signature, a published IP list with a
stable user agent, or reverse DNS — and non-abusive behaviour
(verified bots).
False positives are documented: a missing or empty User-Agent is immediately scored 1, which
is common behind Zero Trust WARP or corporate proxies. JavaScript Detections only runs on HTML page views,
not AJAX, and the first request from a new client usually has no data;
Cache-Control: no-transform prevents injection. It is not enforcement on its own — you must
write a rule on cf.bot_management.js_detection.passed
(JavaScript Detections).
Bot Fight Mode is not on the Ruleset Engine, so Skip, Bypass and Allow have no effect on it, and an IP
Access rule that matches first prevents it. It also needs a Content Security Policy allowance for
/cdn-cgi/challenge-platform/.
What is undocumented matters as much. The specific heuristic checks, the contents of the fingerprint database, the enumerated machine learning features, the model thresholds and the exact computation behind the challenge are not public. Naming them is guessing.
What none of these can tell you
Side by side, the division of labour is clean: rules judge payloads, rate limits judge rates, bot management judges clients. Each is allowed to terminate a request before the next phase sees it.
A request can be innocent on all three axes and still be one of a large set of distributed, slow, well-formed requests. Nothing in the phase order knows what the set is doing; each counter sees its own slice. That is the limit worth carrying away — these controls answer narrow questions, and the questions are not interchangeable. For where they sit alongside TLS, headers and DNS, see the Cyber security overview.