DDoS and WAFs: what the 31.4 Tbps attacks taught me about protecting a login page
In November 2025, a botnet pushed a 31.4 Tbps flood at a single target for 35 seconds. No origin server survives that alone. Here is what actually happened, why the old defences fail, how the layered fix works, an honest WAF comparison, and the minimal Spring Boot build I would run.
In November 2025, a botnet pushed 31.4 terabits per second at a single target, and the whole attack lasted 35 seconds. That is the largest volumetric DDoS ever disclosed publicly, and it is not an outlier. It is the end of a twelve month climb: 5.6 Tbps in October 2024, 7.3 in May 2025, 11.5 and 22.2 in September, 29.7 in the third quarter, then 31.4. Each one lasted well under two minutes.
No origin server survives that alone, and no human responds in 35 seconds. So the defence has to be automatic, layered, and in place before the attack starts. This post covers what actually happened, why the defences most teams start with fail, the layered model that works, an honest comparison of eight WAF options, and the minimal Spring Boot build I would run behind Cloudflare.
1. The 35-second attack that broke the record book#
The timeline tells the story better than any theory. In October 2024, a Mirai-variant flood peaked at 5.6 Tbps against an ISP in Eastern Asia, from about 13,000 IoT devices, and lasted 80 seconds. In mid-May 2025, a multivector flood hit 7.3 Tbps, delivering 37.4 terabytes in 45 seconds from 122,145 IPs across 161 countries. September 2025 brought two more records, 11.5 Tbps and then 22.2 Tbps, each lasting about 35 to 40 seconds. The third quarter record reached 29.7 Tbps over 69 seconds. Then November 2025 set the current mark: 31.4 Tbps in 35 seconds.
Two things changed. First, the size. Cloudflare mitigated 47.1 million DDoS attacks in 2025, up 121 percent year over year, or about 5,376 every hour. Network-layer attacks tripled, from 11.4 million in 2024 to 34.4 million in 2025. Second, the duration. The old image of a DDoS is a siege lasting hours. The new reality is a flash flood lasting seconds. A "Night Before Christmas" campaign in December 2025 ran 902 hyper-volumetric attacks and peaked at 205 million HTTP requests per second.
The target is often not the victim's app at all. These floods aim at a single IP, carpet-bombing tens of thousands of destination ports, and the victim is frequently a hosting provider or a carrier upstream of the app. If your plan is "we will notice it and react," the attack is over before anyone opens a laptop. The mitigation has to be autonomous.
2. Meet Aisuru: a million Android TVs are now a weapon#
The botnet behind most of this escalation is Aisuru, also called Aisuru-Kimwolf, a Mirai descendant with an estimated 1 to 4 million infected hosts. The hosts are mostly Android TVs, routers, and cameras: cheap devices with default passwords, no update path, and always-on internet connections.
That is what changed the math. In October 2024, about 13,000 devices were enough for the record at the time. By late 2025, the same botnet family could throw a million hosts at one target. The packets are randomised, the source ports are carpet-bombed, and the top source networks in Cloudflare's reports include easily provisioned cloud VMs alongside APAC telcos. In other words, the attack comes from everywhere, from devices nobody patches and servers anybody can rent for cents.
There is no blocklist for this. The 7.3 Tbps attack used 122,145 IPs. The Azure record in October 2025, a 15.72 Tbps multivector flood, used more than 500,000 source IPs. Block one IP and the botnet has a million spares. Block a range and you block a whole office behind carrier-grade NAT. Any defence that starts with "block the bad IPs" is already beaten.
3. The L7 attack that did not need bandwidth: HTTP/2 Rapid Reset#
Volumetric floods are not the only problem, and they are not the scariest one. The sharpest lesson of the last three years used almost no bandwidth at all.
HTTP/2 lets many streams share one TCP connection, capped by a setting for maximum concurrent streams. In the Rapid Reset attack, a client opens a stream, the server starts doing the work, and the client immediately sends a RST_STREAM to cancel it. The cancelled stream stops counting against the concurrency cap, so one connection can churn thousands of requests per second. The server does the work, then throws it away. It is protocol-compliant, so it looks like legitimate HTTPS traffic. There is no malicious payload string for a WAF rule to match.
It was exploited in the wild from late August 2023 and disclosed on October 10, 2023 as CVE-2023-44487. The peaks were staggering: Google saw 398 million requests per second, seven and a half times its previous record, with a two-minute attack generating more requests than all Wikipedia article views in September 2023. Cloudflare saw 201 million, AWS 155 million. The botnet behind it was only about 20,000 machines. Virtually every HTTP/2 implementation was affected: Nginx, Apache, Tomcat, IIS, HAProxy, Envoy, gRPC, Node.js, Go, and .NET Kestrel. Fixing it meant patching every implementation and counting cancellations per connection, not writing a regex.
The sequel arrived in August 2025. MadeYouReset (CVE-2025-8671) uses the same underlying gap, but in the opposite direction: the attacker tricks the server into sending the reset, using protocol violations such as an illegal WINDOW_UPDATE or data on a half-closed stream. That bypasses mitigations that only count client-initiated resets. It affected Netty, Apache Tomcat, F5 BIG-IP, Jetty, and others. Cloudflare confirmed it was not susceptible, and no large-scale exploitation was publicly confirmed at disclosure. The lesson stands either way: layer 7 defence is behavioural accounting, counting what clients and servers actually do, not a one-off rule you set and forget.
4. Why your origin cannot take the hit#
Every traditional defence fails against these attacks for a specific, measurable reason.
Origin-only rate limiting. The flood crosses your link, your load balancer, and your TLS termination before any Java filter runs. At 7.3 Tbps, the pipe, the network card, the connection tracking table, and the thread pools saturate first. Rate limiting in the app also costs CPU per request, which is the very resource under attack. And if the app trusts the X-Forwarded-For header without a trusted proxy chain, an attacker spoofs it and gets a fresh rate-limit bucket per request.
A single datacenter or a single IP. Every record above aimed a terabit flood at one IP. No single site has that much transit. Anycast is the only absorption that works: the same IP is announced from hundreds of points of presence, the flood is spread out, and it is dropped at the edge nearest each bot. Without it, you are the bottleneck by design.
IP blocking and IP-only rate limiting. A distributed botnet sends a plausible rate per IP. Half a request per second from one million IPs is 500,000 requests per second, and no per-IP limit ever fires. IP reputation helps as one signal among many. It is never the control.
Autoscaling as mitigation. An autoscaler reads attack traffic as demand and scales into the attack. The bill becomes the attack. Set ceilings, and put the edge in front first.
A WAF signature for a protocol bug. Rapid Reset was protocol-compliant. There was nothing to match. It needed a protocol fix plus reset accounting, not a rule.
The pattern is consistent: each of these defences assumes the attack looks like a small number of bad actors doing something obviously wrong. The 2025 attacks are a huge number of actors doing something that looks almost right.
5. What a login flood actually costs a payments team#
Layer 7 floods target the expensive endpoints on purpose. A search hits the database. A login does a password hash plus a database lookup. A checkout touches the session, the database, and a payment gateway handshake. One POST costs the attacker almost nothing and costs the origin several operations plus a third-party call. That cost asymmetry is the whole layer 7 story, and Rapid Reset is its extreme form.
The downtime numbers people quote are usually stale, so here are dated anchors instead. New Relic's 2025 observability survey put the median cost of a high-impact outage at about 2 million dollars per hour. ITIC's 2024 survey found 98 percent of organisations saying one hour of downtime costs more than 100,000 dollars. Do not quote the old Gartner figure of 5,600 dollars per minute: it is from 2014, and it is still recycled without its date.
The honest way to price it is a formula, not a magic per-minute number: revenue per minute times minutes down, plus failed-payment fees and retries, plus the fraud that slipped through while the team was firefighting, plus SLA and regulatory exposure. A login page that returns 429 to real users during an attack is indistinguishable from being down.
The hidden bill is fraud. Credential stuffing and carding ride on, or hide behind, floods while the team is busy restoring availability. Every failed test transaction still incurs a gateway fee, and successful stuffing converts to account takeover: US account-takeover victims lost almost 16 billion dollars in 2024, according to Javelin research cited via Visa. The background traffic is already mostly automated. The Imperva/Thales Bad Bot Report for 2025 found automated traffic was 51 percent of all web traffic, with bad bots at 37 percent, and 44 percent of advanced bot traffic targeted APIs.
6. The layered model that actually works#
No single layer stops everything. Each layer stops a different thing, and each has a known bypass. In the order traffic meets them:
| Layer | What it stops | What slips through |
|---|---|---|
| 1. Edge absorption, anycast plus CDN | Volumetric layer 3 and 4 floods, dropped near the source | Nothing at layer 7. A valid-looking HTTP flood still arrives as HTTP |
| 2. Layer 3 and 4 filtering | SYN floods, UDP floods, reflection and amplification | Protocol abuse inside a valid connection, and any layer 7 flood that completes a handshake |
| 3. Layer 7 rate limiting at the edge | HTTP floods, credential stuffing, brute force on login. The key is the key: per IP plus per account plus per path, counting failed responses | Distributed low-rate bots, each IP under the threshold, and NAT pools where one IP is thousands of users |
| 4. Bot management and fingerprinting | Automated traffic that mimics humans: TLS fingerprints, device fingerprints, behaviour, a machine-learned bot score | Sophisticated bots using real browsers and residential IPs, mobile APIs with no browser to fingerprint, and good bots that must be allowed |
| 5. Managed rulesets, OWASP Core Rule Set | Known injection classes: SQL injection, cross-site scripting, path traversal, known CVEs, scored so each rule adds to a total | Zero-days, business-logic abuse with no payload to match, and legitimate traffic that looks like an attack |
| 6. Challenge pages, Turnstile and Managed Challenge | Ambiguous traffic. Humans get a way through, scripts do not | Friction for real users if overused, solving services for high-value targets, and pure API traffic with no browser to challenge |
| 7. Origin protection | Direct-to-origin bypass, via Authenticated Origin Pulls (mutual TLS), a firewall allowing only CDN IP ranges, and Full (Strict) TLS | A leaked origin IP, through historic DNS, certificate transparency logs, mail headers, or non-proxied subdomains. If it leaked, rotate it |
What slips through all of it is a low-and-slow, distributed, browser-realistic layer 7 flood against an expensive endpoint, launched from residential IPs at a rate that stays under every per-IP threshold. That is why the post needs per-account, per-endpoint, and response-aware limiting plus bot scores plus origin-side defence in depth, not just "we have a WAF."
7. WAFs, compared honestly#
Prices move, so treat the numbers below as list prices found in mid-2026 compilations and check the vendor page before you quote them. Independent lab tests disagree with each other and with vendor claims, so treat any ranking as a prompt to test your own API surface, not as a verdict.
| WAF | Deployment | Bot management | DDoS tier | Pricing model | Best for |
|---|---|---|---|---|---|
| Cloudflare WAF | Edge CDN, DNS change, 300 plus points of presence | Bot Fight Mode free, Super Bot Fight Mode on Pro and Business, full 1 to 99 bot score on Enterprise | Unmetered layer 3, 4, and 7 on all plans, including Free | Flat per zone, Free to Enterprise | Small team default, and enterprise if you buy Enterprise bot management |
| AWS WAF | Cloud, attached to CloudFront, ALB, API Gateway | Add-on Bot Control, plus account takeover protection | Shield Standard free for layer 3 and 4 only, Shield Advanced around 3,000 dollars a month with a one-year commitment for layer 7 | Pay per use, 5 dollars per WebACL plus 1 dollar per rule plus 0.60 dollars per million requests | Teams already deep on AWS, or low-traffic APIs |
| Azure WAF | Cloud, on Front Door (edge) or Application Gateway (regional) | Basic bot protection on Front Door Premium | Basic infrastructure protection free, DDoS Network Protection around 2,944 dollars a month per virtual network | Front Door Standard about 35 dollars a month (custom rules only, no managed rulesets), Premium about 330 dollars a month | Teams already deep on Azure, on Premium |
| Google Cloud Armor | Cloud, on Google external load balancer | Via reCAPTCHA Enterprise, billed separately, plus Adaptive Protection on Enterprise | Layer 3 and 4 included, layer 7 via WAF rules, Enterprise around 3,000 dollars a month | Pay per use, 5 dollars per policy plus 1 dollar per rule plus 0.75 dollars per million requests | Teams already deep on GCP |
| Akamai App and API Protector | Edge CDN, 4,200 plus points of presence | Separate add-on, Bot Manager Standard or Premier | Prolexic scrubbing as an add-on, not unmetered by default | Quote only, annual contract | Large enterprise, high-traffic, API-heavy, regulated |
| Fastly Next-Gen WAF | Edge, cloud, or on-prem agent | Built in, fingerprinting and behaviour, with an account takeover and payment-fraud focus | Included in Fastly packages | Quote only | DevOps and API-heavy teams that want code-managed WAF and low false positives |
| Imperva Cloud WAF | Cloud, or on-prem appliance | Tiered, full bot and account takeover features on higher tiers | Bundled or add-on by tier, layer 7 DDoS a stated strength | Quote only | Compliance-heavy or hybrid enterprise, cloud plus on-prem |
| ModSecurity / OWASP CRS | Self-hosted module in Apache or Nginx, or Coraza in Caddy, Envoy, or proxy-wasm | None, you build it or bolt on a tool | None, your link is your problem | Zero licence cost, the cost is engineering time, hosting, tuning, and on-call | Learning, a homelab, or a second layer behind a CDN. Not a 2026 starting point for production on its own |
Three honest notes. First, pay-per-request pricing means the bill spikes during a layer 7 flood. The arithmetic: one million requests per second for one hour is 3.6 billion requests, or about 2,160 dollars at 0.60 dollars per million. That is arithmetic, not a bill, but it is the direction the cost goes. Second, quote-only vendors hide the true cost: with Akamai and Imperva, bot management and DDoS scrubbing are add-ons, so the headline price understates the total. Third, the free and open-source option is real but incomplete. ModSecurity with the OWASP Core Rule Set is the reference ruleset other vendors embed, but it gives you no DDoS absorption, no bot management, and no managed service. Trustwave's commercial support ended in July 2024 and the project is now community maintained. If you self-host, use Coraza rather than ModSecurity v3 alone.
My short version: if you are a small team, start with Cloudflare. If you already live on AWS, Azure, or GCP, use that cloud's WAF. If you are a large enterprise with API-heavy, regulated traffic, get quotes from Akamai, Fastly, and Imperva and test them against your own API. Whichever you pick, the comparison is the easy part. The tuning is the work.
8. The minimal real build: Spring Boot behind Cloudflare#
The principle: the edge does the cheap, high-volume work (drop, challenge, rate-limit) and the origin does the expensive, stateful work (authentication, per-account limits, business logic) and never trusts the edge blindly. Nothing here is full code, just the rule logic.
The topology, in order:
Internet -> Cloudflare (DNS proxied) -> [DDoS rules -> WAF custom rules -> rate limiting -> managed rules -> bot and Turnstile checks]
-> Origin: load balancer / Spring Boot (Tomcat), firewall allows only Cloudflare IP ranges, Authenticated Origin Pulls required
-> Database / Redis (Bucket4j store) / payment gateway
WAF custom rules, in priority order. Block known-bad traffic cheaply: an ASN from a residential-proxy or bulletproof-hosting provider you do not serve, or a country outside your markets, on /api/*, gets blocked. Protect non-API surfaces: /admin/* from any IP outside the office or VPN allowlist gets blocked. An allowlist is fine here because it is a small, known set, unlike allowlisting the whole internet. Challenge odd clients on the API: a request to /api/ with a user agent of curl or python-requests, from an IP that is not a known integration, gets a Managed Challenge rather than a block. Skip managed rules narrowly, by rule ID plus path: if a managed rule fires on POST /api/v1/search, skip that rule ID on that path only. Never skip /api/* and never disable a whole ruleset for one false positive. Turn on the Cloudflare Managed Ruleset and the OWASP Core Ruleset in Block, at medium sensitivity to start, and leave the layer 7 DDoS managed ruleset at its defaults.
Rate limiting rules, as starting points to tune from your own baseline. Login brute force: POST /api/v1/auth/login, keyed on IP plus username or email, 5 attempts per minute per IP-plus-account and 20 per minute per IP, then Managed Challenge, then Block for 10 minutes. Failed-login counting: same path, but count only 401 and 403 responses, 10 failed attempts per 5 minutes, then Block for 15 minutes. Password reset and one-time passcode: 3 per 10 minutes per IP-plus-account, then Block for 30 minutes, because these trigger emails and text messages, which cost money. Checkout and payments: 10 per minute per authenticated user and 30 per minute per IP, then Managed Challenge. General API traffic: 1,000 per minute per visitor, keyed on the NAT-aware visitor ID rather than the raw IP, so an office behind carrier-grade NAT is not one bucket, set from the 95th percentile of real traffic times three to five. One caution from Cloudflare's own docs: rate limiting is not precise, because counters update with a delay of a few seconds.
Bot Fight Mode versus Super Bot Fight Mode versus Bot Management. Bot Fight Mode is free, one toggle, domain-wide, and it challenges detected bots automatically. It cannot be skipped by WAF custom rules and has no per-endpoint or per-score control, so test it before using it on a pure API domain, where machine clients have no browser to pass a challenge. Super Bot Fight Mode, on Pro and Business, adds per-category actions and bot analytics, and it is the right tier for a small team that needs some control without Enterprise. Bot Management, on Enterprise, gives a per-request bot score from 1 to 99 that you can use in WAF rules per endpoint, for example a score below 30 on login gets a JavaScript challenge and below 10 gets blocked. Logpush, the raw log export, is also Enterprise-only.
Turnstile on login. Put the Turnstile widget in Managed mode on login, signup, and password reset, not on every request. On the server, verify the token first by posting to Cloudflare's siteverify endpoint with your secret and the remote IP from CF-Connecting-IP, before hashing the password or hitting the database. The token is single-use with a five-minute expiry, and pin the action (login versus signup) so a token minted on signup cannot be replayed on login. Fail closed on verification failure. Better still, show Turnstile only when something is already suspicious, for example after three failed logins from one IP in 15 minutes. Normal users get no friction, bots get the expensive path.
Authenticated Origin Pulls and origin lockdown. Enable Authenticated Origin Pulls so Cloudflare presents a client certificate on every origin pull, and the origin verifies it and refuses any TLS connection without it. Firewall the origin to Cloudflare's published IP ranges only. Use Full (Strict) TLS from edge to origin, never Flexible, which sends plaintext from edge to origin. Rotate the origin IP if it has ever leaked through historic DNS records, certificate transparency logs, mail headers, or a non-proxied subdomain. And proxy every record that serves the app: a single DNS-only record for the same host is a bypass.
Spring Boot, the origin-side second layer. Configure the trusted proxy properly (server.forward-headers-strategy set to NATIVE, or FRAMEWORK with a ForwardedHeaderFilter, and Tomcat trusted-proxies set to Cloudflare's ranges) and read the real client IP from CF-Connecting-IP or getRemoteAddr after that config. Never read X-Forwarded-For directly, because it is client-spoofable, and a spoofed header gives the attacker a fresh rate-limit bucket per request. Use Bucket4j with Redis for distributed buckets: per IP, per IP per endpoint, per account after authentication, and per API key. Put the login limiter before the credential check and the quota limiter after authentication. Return 429 with a Retry-After header and the standard RateLimit headers. Local in-memory buckets alone do not work across pods. Keep the app's own limits looser than the edge's, so the edge trips first and the origin limiter is the backstop if the edge is bypassed or misconfigured. And do not log secrets: log the rule ID, bot score, CF-Ray, path, and outcome, never passwords, tokens, or card data.
9. What to log, alert on, and drill before the next flood#
A WAF nobody watches is a dashboard, not a defence. Alert on changes, not on every block, or the alerts get ignored. Watch WAF Security Events by rule and action, and alert on a spike in Blocks on login or checkout, a new rule ID firing, or Blocks on a previously clean path. Watch the 429 rate at the edge and the origin, and alert when it rises above baseline for legitimate clients. Watch the bot score distribution, origin 5xx and latency percentiles, the failed-login rate, the payment success rate, Turnstile solve rates, and direct-hit attempts on the origin (any direct hit means the origin IP is known). Keep a synthetic login-plus-checkout probe that runs outside Cloudflare, so a probe failure tells you whether Cloudflare is down or your origin is down.
Run three drills before you need them. First, flip a managed ruleset to Log, watch for a week, then promote it to Block. Second, load test through Cloudflare, with their knowledge and in a test zone, against login at ten times baseline, and confirm the rate-limit and challenge path trips before the origin saturates. Third, rehearse an origin IP leak: rotate the IP and update the firewall.
10. Seven mistakes I keep seeing#
- WAF in Log-only mode forever. Teams enable it "temporarily" to avoid breaking traffic, then never flip it. It detects attacks and blocks nothing. Time-box it to one or two weeks for a managed ruleset, quantify the false positives from the logs, then promote it to Block.
- Blocking legitimate traffic on day one. Enabling managed rules in Block without testing against real traffic, and the first false positive is discovered through customer complaints. Log first, then skip narrowly by rule ID and path.
- Overly broad bypasses to fix false positives. Skipping
/api/*, skipping by a spoofable header, skipping "internal" IPs. Each one is a highway for attackers. Make the narrowest possible skip, with a ticket and an expiry date. - Relying on IP blocking or IP-only rate limiting. A million rotating residential IPs beat every blocklist, and a distributed botnet stays under every per-IP threshold. Use per-account, per-endpoint, behavioural, and fingerprint signals as well.
- No rate limiting on auth endpoints. Login, reset-password, one-time passcode, and signup are the most abused endpoints and often the only ones without limits, because "users must be able to log in." They need the strictest limits, counted on failed attempts, with Turnstile escalation.
- Forgetting to protect the origin IP. The whole edge config is bypassed in one request if the origin IP is reachable directly. Firewall it to the CDN ranges, require Authenticated Origin Pulls, and rotate it if it leaked.
- Trusting X-Forwarded-For without validation. A spoofed header gives the attacker a fresh rate-limit bucket per request. Use a trusted proxy chain and CF-Connecting-IP.
One more caution, and it is the honest caveat to everything above. On November 18, 2025, Cloudflare itself went down for about three hours, not from a DDoS but from its own Bot Management config file. A database permissions change made a query return duplicate rows, the feature file it feeds doubled in size, exceeded the 200-feature limit in the proxy, and the proxy panicked. Engineers first suspected a hyper-scale attack, because an Aisuru attack was happening at the same time. Core traffic was largely normal by 2:30 p.m. UTC. The lesson is not "do not use the edge." The lesson is that the edge is itself a global single point of failure, and config propagation can fail globally in minutes. Keep a synthetic probe outside the edge, keep a runbook for "the edge is down," and do not assume the vendor's status page will be reachable when you need it.
The attacks are not going back to hours-long sieges from a few hundred servers. They are 35-second flash floods from a million televisions, and layer 7 attacks that need no bandwidth at all. The fix is not one product. It is an edge that absorbs and filters automatically, rate limits keyed on accounts and behaviour rather than IPs, bot detection that escalates to challenges instead of guessing, an origin that trusts nothing it has not verified, and drills run before the flood, not during it. Build that, and the next record attack is a spike in your dashboard, not an outage.
