
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Sat, 04 Apr 2026 11:21:30 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Training a million models per day to save customers of all sizes from DDoS attacks]]></title>
            <link>https://blog.cloudflare.com/training-a-million-models-per-day-to-save-customers-of-all-sizes-from-ddos/</link>
            <pubDate>Wed, 23 Oct 2024 13:00:00 GMT</pubDate>
            <description><![CDATA[ In this post we will describe how we use anomaly detection to watch for novel DDoS attacks. We’ll provide an overview of how we build models which flag unusual traffic and keep our customers safe. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Our always-on DDoS protection runs inside every server across our global network.  It constantly analyzes incoming traffic, looking for signals associated with previously identified DDoS attacks. We dynamically create <a href="https://developers.cloudflare.com/ddos-protection/about/how-ddos-protection-works/"><u>fingerprints</u></a> to flag malicious traffic, which is dropped when detected in high enough volume — so it never reaches its destination — keeping customer websites online.</p><p>In many cases, flagging bad traffic can be straightforward. For example, if we see too many requests to a destination with the same protocol violation, we can be fairly sure this is an automated script, rather than a surge of requests from a legitimate web browser.</p><p>Our DDoS systems are great at detecting attacks, but there’s a minor catch. Much like the human immune system, they are great at spotting attacks similar to things they have seen before. But for new and novel threats, they need a little help knowing what to look for, which is an expensive and time-consuming human endeavor.</p><p>Cloudflare protects millions of Internet properties, and we serve over 60 million HTTP requests per second on average, so trying to find unmitigated attacks in such a huge volume of traffic is a daunting task. In order to protect the smallest of companies, we need a way to find unmitigated attacks that may only be a few thousand requests per second, as even these can be enough to take smaller sites offline.</p><p>To better protect our customers, we also have a system to automatically identify unmitigated, or partially mitigated DDoS attacks, so we can better shore up our defenses against emerging threats. In this post we will introduce this anomaly detection pipeline, we’ll provide an overview of how it builds statistical models which flag unusual traffic and keep our customers safe. Let’s jump in!</p>
    <div>
      <h2>A naive volumetric model</h2>
      <a href="#a-naive-volumetric-model">
        
      </a>
    </div>
    <p>A DDoS attack, by definition, is characterized by a higher than normal volume of traffic destined for a particular destination. We can use this fact to loosely sketch out a potential approach. Let’s look at an example website, and look at the request volume over the course of a day, broken down into 1 minute intervals.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6j97IMawigCOtQEIKLzQ4n/8ab1e487a5dc8faaecc732b8fbb7d8d4/image3.png" />
          </figure><p>We can plot this same data as a histogram:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1Ys3wf2GY6e5K4rEBUTDBN/5cff86a1f90ee5e0eae9ec394f2322b3/image6.png" />
          </figure><p>The data follows a bell-shaped curve, also known as a normal distribution. We can use this fact to flag observations which appear outside the usual range. By first calculating the mean and standard deviation of our dataset, we can then use these values to rate new observations by calculating how many standard deviations (or sigma) the data is from the mean.</p><p>This value is also called the z-score — a z-score of 3 is the same as 3-sigma, which corresponds to 3 standard deviations from the mean. A data point with a high enough z-score is sufficiently unusual that it might signal an attack. Since the mean and standard deviation are stationary, we can calculate a request volume threshold for each z-score value, and use traffic volumes above these thresholds to signal an ongoing attack.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4X5WaA5QssNRlWWaz4UUYL/05b88c9cfe52f6ba05cef7cab033d53d/image1.png" />
          </figure><p><sup><i>Trigger thresholds for z-score of 3, 4 and 5</i></sup></p><p>Unfortunately, it’s incredibly rare to see traffic that is this uniform in practice, as user load will naturally vary over a day. Here I’ve simulated some traffic for a website which runs a meal delivery service, and as you might expect it has big peaks around meal times, and low traffic overnight since it only operates in a single country.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6Pk6sFmz8lqjUJrdTev8Xw/194436196eddbbb11576b74f1515d6c6/image2.png" />
          </figure><p>Our volume data no longer follows a normal distribution and our 3-sigma threshold is now much further away, so smaller attacks could pass undetected.</p><p>Many websites elastically scale their underlying hardware based upon anticipated load to save on costs. In the example above the website operator would run far fewer servers overnight, when the anticipated load is low, to save on running costs. This makes the website more vulnerable to attacks during off-peak hours as there would be less hardware to absorb them. An attack as low as a few hundred requests per minute may be enough to overwhelm the site early in the morning, even though the peak-time infrastructure could easily absorb this volume.</p><p>This approach relies on traffic volume being stable over time, meaning it’s roughly flat throughout the day, but this is rarely true in practice. Even when it is true, benign increases in traffic are common, such as an e-commerce site running a Black Friday sale. In this situation, a website would expect a surge in traffic that our model wouldn’t anticipate, and we may incorrectly flag real shoppers as attackers.</p><p>It turns out this approach makes too many naive assumptions about what traffic should look like, so it’s impossible to choose an appropriate sigma threshold which works well for all customers.</p>
    <div>
      <h2>Time series forecasting</h2>
      <a href="#time-series-forecasting">
        
      </a>
    </div>
    <p>Let’s continue with trying to determine a volumetric baseline for our meal delivery example. A reasonable assumption we could add is that yesterday’s traffic shape should approximate the expected shape of traffic today. This idea is called “seasonality”. Weekly seasonality is also pretty common, i.e. websites see more or less traffic on certain weekdays or on weekends.</p><p>There are many methods designed to analyze a dataset, unpick the varying horizons of seasonality within it, and then build an appropriate predictive model. We won’t go into them here but reading about <a href="https://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average"><u>Seasonal ARIMA (SARIMA)</u></a> is a good place to start if you are looking for further information.</p><p>There are three main challenges that make SARIMA methods unsuitable for our purposes. First is that in order to get a good idea of seasonality, you need a lot of data. To predict weekly seasonality, you need at least a few weeks worth of data. We’d require a massive dataset to predict monthly, or even annual, patterns (such as Black Friday). This means new customers wouldn’t be protected until they’d been with us for multiple years, so this isn’t a particularly practical approach.</p><p>The second issue is the cost of training models. In order to maintain good accuracy, time series models need to be frequently retrained. The exact frequency varies between methods, but in the worst cases, a model is only good for 2–3 inferences, meaning we’d need to retrain all our models every 10–20 minutes. This is feasible, but it’s incredibly wasteful.</p><p>The third hurdle is the hardest to work around, and is the reason why a purely volumetric model doesn’t work. Most websites experience completely benign spikes in traffic that lie outside prior norms. Flash sales are one such example, or 1,000,000 visitors driven to a site from Reddit, or a Super Bowl commercial.</p>
    <div>
      <h2>A better way?</h2>
      <a href="#a-better-way">
        
      </a>
    </div>
    <p>So if volumetric modeling won’t work, what can we do instead? Fortunately, volume isn’t the only axis we can use to measure traffic. Consider the end users’ browsers for example. It would be reasonable to assume that over a given time interval, the proportion of users across the top 5 browsers would remain reasonably stationary, or at least within a predictable range. More importantly, this proportion is unlikely to change too much during benign traffic surges.</p><p>Through careful analysis we were able to discover about a dozen such variables with the following features for a given zone: </p><ul><li><p>They follow a normal distribution</p></li><li><p>They aren’t correlated, or are only loosely correlated with volume</p></li><li><p>They deviate from the underlying normal distribution during “under attack” events</p></li></ul><p>Recall our initial volume model, where we used z-score to define a cutoff. We can expand this same idea to multiple dimensions. We have a dozen different time series (each feature is a single time series), which we can imagine as a cloud of points in 12 dimensions. Here is a sample showing 3 such features, with each point representing the traffic readings at a different point in time. Note that both graphs show the same cloud of points from two different angles.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5idkNYYgL0IhY8d2HapYud/f3696ec7fb91f8641a04ba261d0cf673/image4.png" />
          </figure><p>To use our z-score analogy from before, we’d want our points to be spherical, since our multidimensional- z-score is then just the distance from the centre of the cloud. We could then use this distance to define a cutoff threshold for attacks.</p><p>For several reasons, a perfect sphere is unlikely in practice. Our various features measure different things, so they have very different scales of ‘normal’. One property might vary between 100-300 whereas another property might usually occupy the interval 0-1. A change of 3 in this latter property would be a significant anomaly, whereas in the first this would just be within the normal range.</p><p>More subtly, two or more axes may be correlated, so an increase in one is usually mirrored with a proportional increase/decrease in another dimension. This turns our sphere into an off-axis disc shape, as pictured above.</p><p>Fortunately, we have a couple of mathematical tricks up our sleeve. The first is scale normalization. In each of our n dimensions, we subtract the mean, and divide by the standard deviation. This makes all our dimensions the same size and centres them around zero. This gives a multidimensional analogue of z-score, but it won’t fix the disc shape.</p><p>What we can do is figure out the orientation and dimensions of the disc, and for this we use a tool called <a href="https://en.wikipedia.org/wiki/Principal_component_analysis"><u>Principal Component Analysis (PCA)</u></a>. This lets us reorient our disc, and rescale the axes according to their size, to make them all the same.</p><p>Imagine grabbing the disc out of the air, then drawing new X and Y axes on the top surface, with the origin at the center of the disc. Our new Z-axis is the thickness of the disc. We can compare the thickness to the diameter of the disc, to give us a scaling factor for the Z direction. Imagine stretching the disc along the z-axis until it’s as tall as the length across the diameter.</p><p>In reality there’s nothing to say that X &amp; Y have to be the same size either, but hopefully you get the general idea. PCA lets us draw new axes along these lines of correlation in an arbitrary number of dimensions, and convert our n-dimensional disc into a nicely behaved sphere of points (technically an n-dimensional sphere).</p><p>Having done all this work, we can uniquely define a coordinate transformation which takes any measurement from our raw features, and tells us where it should lie in the sphere, and since all our dimensions are the same size we can generate an anomaly score purely based on its distance from the centre of the cloud.</p><p>As a final trick, we can also use a final scaling operation to ensure the sphere for dataset A is the same size as the sphere generated from dataset B, meaning we can do this same process for any traffic data and define a cutoff distance λ which is the same across all our models. Rather than fine-tuning models for each individual customer zone, we can tune this to a value which applies globally.</p><p>Another name for this measurement is <a href="https://en.wikipedia.org/wiki/Mahalanobis_distance"><u>Mahalanobis distance</u></a>. (Inclined readers can understand this equivalence by considering the role of the covariance matrix in PCA and Mahalanobis distance. Further discussion can be found on <a href="https://stats.stackexchange.com/questions/166525/is-mahalanobis-distance-equivalent-to-the-euclidean-one-on-the-pca-rotated-data"><u>this</u></a> StackExchange post.) We further tune the process to discard dimensions with little variance — if our disc is too thin we discard the thickness dimension.  In practice, such dimensions were too sensitive to be useful.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1OcPc7zoehsizwzPEkD1Fc/094bd59ca6d6aba3c301fd74f12d580a/image5.png" />
          </figure><p>We’re left with a multidimensional analogue of the z-score we started with, but this time our variables aren’t correlated with peacetime traffic volume. Above we show 2 output dimensions, with coloured circles which show Mahalanobis distances of 4, 5 and 6. Anything outside the green circle will be classified as an attack.</p>
    <div>
      <h2>How we train ~1 million models daily to keep customers safe</h2>
      <a href="#how-we-train-1-million-models-daily-to-keep-customers-safe">
        
      </a>
    </div>
    <p>The approach we’ve outlined is incredibly parallelizable: a single model requires only the traffic data for that one website, and the datasets needed can be quite small. We use 4 weeks of training data chunked into 5 minute intervals which is only ~8k rows/website.</p><p>We run all our training and inference in an Apache Airflow deployment in Kubernetes. Due to the parallelizability, we can scale horizontally as needed. On average, we can train about 3 models/second/thread. We currently retrain models every day, but we’ve observed very little intraday model drift (i.e. yesterday’s model is the same as today’s), so training frequency may be reduced in the future.</p><p>We don’t consider it necessary to build models for all our customers, instead we train models for a large sample of representative customers, including a large number on the Free plan. The goal is to identify attacks for further study which we then use to tune our existing DDoS systems for all customers.</p>
    <div>
      <h2>Join us!</h2>
      <a href="#join-us">
        
      </a>
    </div>
    <p>If you’ve read this far you may have questions, like “how do you filter attacks from your training data?” or you may have spotted a handful of other technical details which I’ve elided to keep this post accessible to a general audience. If so, you would fit in well here at Cloudflare. We’re helping to build a better Internet, and we’re <a href="https://www.cloudflare.com/careers/jobs/?title=data+scientist"><u>hiring</u></a>.</p> ]]></content:encoded>
            <category><![CDATA[DDoS]]></category>
            <category><![CDATA[Deep Dive]]></category>
            <category><![CDATA[Machine Learning]]></category>
            <guid isPermaLink="false">4awe2vvz8flXFLuz3BGm7j</guid>
            <dc:creator>Nick Wood</dc:creator>
            <dc:creator>Manish Arora</dc:creator>
        </item>
        <item>
            <title><![CDATA[How Cloudflare auto-mitigated world record 3.8 Tbps DDoS attack]]></title>
            <link>https://blog.cloudflare.com/how-cloudflare-auto-mitigated-world-record-3-8-tbps-ddos-attack/</link>
            <pubDate>Wed, 02 Oct 2024 13:00:00 GMT</pubDate>
            <description><![CDATA[ Over the past couple of weeks, Cloudflare's DDoS protection systems have automatically and successfully mitigated multiple hyper-volumetric L3/4 DDoS attacks exceeding 3 billion packets per second (Bpps). Our systems also automatically mitigated multiple attacks exceeding 3 terabits per second (Tbps), with the largest ones exceeding 3.65 Tbps. The scale of these attacks is unprecedented. ]]></description>
            <content:encoded><![CDATA[ <p>Since early September, <a href="https://developers.cloudflare.com/ddos-protection/about/components/#autonomous-edge"><u>Cloudflare's DDoS protection systems</u></a> have been combating a month-long campaign of hyper-volumetric L3/4 DDoS attacks. Cloudflare’s defenses mitigated over one hundred hyper-volumetric L3/4 DDoS attacks throughout the month, with many exceeding 2 billion packets per second (Bpps) and 3 terabits per second (Tbps). The largest attack peaked 3.8 Tbps — the largest ever disclosed publicly by any organization. Detection and mitigation was fully autonomous. The graphs below represent two separate attack events that targeted the same Cloudflare customer and were mitigated autonomously.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7hXUgmEd37kzZrMs0KPXLl/21a4779022bdff91f760dc66759eb955/BLOG-2586_2.png" />
          </figure><p><sup><i>A mitigated 3.8 Terabits per second DDoS attack that lasted 65 seconds</i></sup></p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1uxvtlkdFoH6KU6waXxK3o/d17fe7cf0e33c20e64a47b3ca0e6ca63/BLOG-2586_3.png" />
          </figure><p><sup><i>A mitigated 2.14 billion packet per second DDoS attack that lasted 60 seconds</i></sup></p>
    <div>
      <h2>Cloudflare customers are protected</h2>
      <a href="#cloudflare-customers-are-protected">
        
      </a>
    </div>
    <p>Cloudflare customers using Cloudflare’s HTTP reverse proxy services (e.g. <a href="https://developers.cloudflare.com/waf/"><u>Cloudflare WAF</u></a> and <a href="https://developers.cloudflare.com/cache/"><u>Cloudflare CDN</u></a>) are automatically protected.</p><p>Cloudflare customers using <a href="https://developers.cloudflare.com/spectrum/"><u>Spectrum</u></a> and <a href="https://developers.cloudflare.com/magic-transit/"><u>Magic Transit</u></a> are also automatically protected. Magic Transit customers can further optimize their protection by deploying <a href="https://developers.cloudflare.com/magic-firewall/"><u>Magic Firewall</u></a> rules to enforce a strict positive and negative security model at the packet layer.</p>
    <div>
      <h2>Other Internet properties may not be safe</h2>
      <a href="#other-internet-properties-may-not-be-safe">
        
      </a>
    </div>
    <p>The scale and frequency of these attacks are unprecedented. Due to their sheer size and bits/packets per second rates, these attacks have the ability to take down unprotected Internet properties, as well as Internet properties that are protected by on-premise equipment or by cloud providers that just don’t have sufficient network capacity or global coverage to be able to handle these volumes alongside legitimate traffic without impacting performance. </p><p>Cloudflare, however, does have the network capacity, global coverage, and intelligent systems needed to absorb and automatically mitigate these monstrous attacks. </p><p>In this blog post, we will review the attack campaign and why its attacks are so severe. We will describe the anatomy of a Layer 3/4 DDoS attack, its objectives, and how attacks are generated. We will then proceed to detail how Cloudflare’s systems were able to autonomously detect and mitigate these monstrous attacks without impacting performance for our customers. We will describe the key aspects of our defenses, starting with how our systems generate real-time (dynamic) signatures to match the attack traffic all the way to how we leverage kernel features to drop packets at wire-speed.</p>
    <div>
      <h2>Campaign analysis</h2>
      <a href="#campaign-analysis">
        
      </a>
    </div>
    <p>We have observed this attack campaign targeting multiple customers in the financial services, Internet, and telecommunication industries, among others. This attack campaign targets bandwidth saturation as well as resource exhaustion of in-line applications and devices.</p><p>The attacks predominantly leverage <a href="https://www.cloudflare.com/learning/ddos/glossary/user-datagram-protocol-udp/"><u>UDP</u></a> on a fixed port, and originated from across the globe with larger shares coming from Vietnam, Russia, Brazil, Spain, and the US. </p><p>The high packet rate attacks appear to originate from multiple types of compromised devices, including MikroTik devices, DVRs, and Web servers, orchestrated to work in tandem and flood the target with exceptionally large volumes of traffic. The high bitrate attacks appear to originate from a large number of compromised ASUS home routers, likely exploited using <a href="https://censys.com/june-20-improper-authentication-vulnerability-in-asus-routers/"><u>a CVE 9.8 (Critical) vulnerability that was recently discovered by Censys</u></a>.</p><div>
    <figure>
        <table>
            <colgroup>
                <col></col>
                <col></col>
            </colgroup>
            <tbody>
                <tr>
                    <td>
                        <p><span><span>Russia</span></span></p>
                    </td>
                    <td>
                        <p><span><span>12.1%</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Vietnam</span></span></p>
                    </td>
                    <td>
                        <p><span><span>11.6%</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>United States</span></span></p>
                    </td>
                    <td>
                        <p><span><span>9.3%</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Spain</span></span></p>
                    </td>
                    <td>
                        <p><span><span>6.5%</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Brazil</span></span></p>
                    </td>
                    <td>
                        <p><span><span>4.7%</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>France</span></span></p>
                    </td>
                    <td>
                        <p><span><span>4.7%</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Romania</span></span></p>
                    </td>
                    <td>
                        <p><span><span>4.4%</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Taiwan</span></span></p>
                    </td>
                    <td>
                        <p><span><span>3.4%</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>United Kingdom</span></span></p>
                    </td>
                    <td>
                        <p><span><span>3.3%</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Italy</span></span></p>
                    </td>
                    <td>
                        <p><span><span>2.8%</span></span></p>
                    </td>
                </tr>
            </tbody>
        </table>
    </figure>
</div><p><sup><i>Share of packets observed by source location</i></sup></p>
    <div>
      <h2>Anatomy of DDoS attacks</h2>
      <a href="#anatomy-of-ddos-attacks">
        
      </a>
    </div>
    <p>Before we discuss how Cloudflare automatically detected and mitigated the largest DDoS attacks ever seen, it‘s important to understand the basics of DDoS attacks. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7HLtAHnyjS33iiJAR1B9h9/2e1fc2cab871440fc95fa803989ae156/BLOG-2586_5.png" />
          </figure><p><sup><i>Simplified diagram of a DDoS attack</i></sup></p><p>The goal of a <a href="https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/"><u>Distributed Denial of Service (DDoS) attack</u></a> is to deny legitimate users access to a service. This is usually done by exhausting resources needed to provide the service. In the context of these recent Layer 3/4 DDoS attacks, that resource is CPU cycles and network bandwidth.</p>
    <div>
      <h3>Exhausting CPU cycles</h3>
      <a href="#exhausting-cpu-cycles">
        
      </a>
    </div>
    <p>Processing a packet consumes CPU cycles. In the case of regular (non-attack) traffic, a <i>legitimate</i> packet received by a service will cause that service to perform some action, and different actions require different amounts of CPU processing. However, before a packet is even delivered to a service there is per-packet work that needs to be done. Layer 3 packet headers need to be parsed and processed to deliver the packet to the correct machine and interface. Layer 4 packet headers need to be processed and routed to the correct socket (if any). There may be multiple additional processing steps that inspect every packet. Therefore, if an attacker sends at a high enough packet rate, then they can potentially saturate the available CPU resources, denying service to legitimate users.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3aBbNG4Fc7TY6MTugLl3BE/064fb17761aebbce737a5a4518a14235/BLOG-2586_6.png" />
          </figure><p>To defend against high packet rate attacks, you need to be able to inspect and discard the bad packets using as few CPU cycles as possible, leaving enough CPU to process the good packets. You can additionally acquire more, or faster, CPUs to perform the processing — but that can be a very lengthy process that bears high costs. </p>
    <div>
      <h3>Exhausting network bandwidth</h3>
      <a href="#exhausting-network-bandwidth">
        
      </a>
    </div>
    <p>Network bandwidth is the total amount of data per time that can be delivered to a server. You can think of bandwidth like a pipe to transport water. The amount of water we can deliver through a drinking straw is less than what we could deliver through a garden hose. If an attacker is able to push more garbage data into the pipe than it can deliver, then both the bad data <i>and</i> the good data will be discarded upstream, at the entrance to the pipe, and the DDoS is therefore successful.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/OehVItOhGfP9ApllRvDDM/fce73e6f375173a1a53bc22026e0b9b1/BLOG-2586_7.png" />
          </figure><p>
Defending against attacks that can saturate network bandwidth can be difficult because there is very little that can be done if you are on the downstream side of the saturated pipe. There are really only a few choices: you can get a bigger pipe, you can potentially find a way to move the good traffic to a new pipe that isn’t saturated, or you can hopefully ask the upstream side of the pipe to stop sending some or all of the data into the pipe.</p>
    <div>
      <h2>Generating DDoS attacks</h2>
      <a href="#generating-ddos-attacks">
        
      </a>
    </div>
    <p>If we think about what this means from the attackers point of view you realize there are similar constraints. Just as it takes CPU cycles to receive a packet, it also takes CPU cycles to create a packet. If, for example, the cost to send and receive a packet were equal, then the attacker would need an equal amount of CPU power to generate the attack as we would need to defend against it. In most cases this is not true — there is a cost asymmetry, as the attacker is able to generate packets using fewer CPU cycles than it takes to receive those packets. However, it is worth noting that generating attacks is not free and can require a large amount of CPU power.</p><p>Saturating network bandwidth can be even more difficult for an attacker. Here the attacker needs to be able to output more bandwidth than the target service has allocated. They actually need to be able to exceed the capacity of the receiving service. This is so difficult that the most common way to achieve a network bandwidth attack is to use a reflection/amplification attack method, for example a <a href="https://www.cloudflare.com/learning/ddos/dns-amplification-ddos-attack/"><u>DNS Amplification attack</u></a>. These attacks allow the attacker to send a small packet to an intermediate service, and the intermediate service will send a large packet to the victim.</p><p>In both scenarios, the attacker needs to acquire or gain access to many devices to generate the attack. These devices can be acquired in a number of different ways. They may be server class machines from cloud providers or hosting services, or they can be compromised devices like DVRs, routers, and webcams that have been infected with the attacker’s malware. These machines together form the botnet.</p>
    <div>
      <h2>How Cloudflare defends against large attacks</h2>
      <a href="#how-cloudflare-defends-against-large-attacks">
        
      </a>
    </div>
    <p>Now that we understand the fundamentals of how DDoS attacks work, we can explain how Cloudflare can defend against these attacks.</p>
    <div>
      <h3>Spreading the attack surface using global anycast</h3>
      <a href="#spreading-the-attack-surface-using-global-anycast">
        
      </a>
    </div>
    <p>The first not-so-secret ingredient is that Cloudflare’s network is built on <a href="https://www.cloudflare.com/learning/cdn/glossary/anycast-network/"><u>anycast</u></a>. In brief, anycast allows a single IP address to be advertised by multiple machines around the world. A packet sent to that IP address will be served by the closest machine. This means when an attacker uses their distributed botnet to launch an attack, the attack will be received in a distributed manner across the Cloudflare network. An infected DVR in Dallas, Texas will send packets to a Cloudflare server in Dallas. An infected webcam in London will send packets to a Cloudflare server in London.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/48tW6A6ACUT4Fd9h3l70F4/c6bcea8f037fc853477d0987c939e007/BLOG-2586_8.png" />
          </figure><p><sup><i>Anycast vs. Unicast networks</i></sup></p><p>Our anycast network additionally allows Cloudflare to allocate compute and bandwidth resources closest to the regions that need them the most. Densely populated regions will generate larger amounts of legitimate traffic, and the data centers placed in those regions will have more bandwidth and CPU resources to meet those needs. Sparsely populated regions will naturally generate less legitimate traffic, so Cloudflare data centers in those regions can be sized appropriately. Since attack traffic is mainly coming from compromised devices, those devices will tend to be distributed in a manner that matches normal traffic flows sending the attack traffic proportionally to datacenters that can handle it. And similarly, within the datacenter, traffic is distributed across multiple machines.</p><p>Additionally, for high bandwidth attacks, Cloudflare’s network has another advantage. A large proportion of traffic on the Cloudflare network does not consume bandwidth in a symmetrical manner. For example, an HTTP request to get a webpage from a site behind Cloudflare will be a relatively small incoming packet, but produce a larger amount of outgoing traffic back to the client. This means that the Cloudflare network tends to egress far more legitimate traffic than we receive. However, the network links and bandwidth allocated are symmetrical, meaning there is an abundance of ingress bandwidth available to receive volumetric attack traffic.</p>
    <div>
      <h3>Generating real-time signatures</h3>
      <a href="#generating-real-time-signatures">
        
      </a>
    </div>
    <p>By the time you’ve reached an individual server inside a datacenter, the bandwidth of the attack has been distributed enough that none of the upstream links are saturated. That doesn’t mean the attack has been fully stopped yet, since we haven’t dropped the bad packets. To do that, we need to sample traffic, qualify an attack, and create rules to block the bad packets. </p><p>Sampling traffic and dropping bad packets is the job of our <a href="https://blog.cloudflare.com/l4drop-xdp-ebpf-based-ddos-mitigations/"><u>l4drop</u></a> component, which uses <a href="https://netdevconf.info/2.1/papers/Gilberto_Bertin_XDP_in_practice.pdf"><u>XDP (eXpress Data Path)</u></a> and leverages an extended version of the Berkeley Packet Filter known as <a href="https://blog.cloudflare.com/tag/ebpf/"><u>eBPF (extended BPF)</u></a>. This enables us to execute custom code in kernel space and process (drop, forward, or modify) each packet directly at the network interface card (NIC) level. This component helps the system drop packets efficiently without consuming excessive CPU resources on the machine. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1NUxGTvKFs5l6G2UCSxvqw/3632f6728f9361123169d9694c807f0b/BLOG-2586_9.png" />
          </figure><p><sup><i>Cloudflare DDoS protection system overview</i></sup></p><p>We use XDP to sample packets to look for suspicious attributes that indicate an attack. The samples include fields such as the source IP, source port, destination IP, destination port, protocol, TCP flags, sequence number, options, packet rate and more. This analysis is conducted by the <i>denial of service daemon (dosd).</i> <i>Dosd</i> holds our secret sauce. It has many <i>filters</i> which instruct it, based on our curated heuristics, when to initiate mitigation. To our customers, these filters are logically grouped by attack vectors and exposed as the <a href="https://developers.cloudflare.com/ddos-protection/managed-rulesets/"><u>DDoS Managed Rules</u></a>. Our customers can <a href="https://developers.cloudflare.com/ddos-protection/managed-rulesets/adjust-rules/"><u>customize their behavior</u></a> to some extent, as needed.</p><p>As it receives samples from XDP, dosd will generate multiple permutations of fingerprints for suspicious traffic patterns. Then, using a data streaming algorithm, dosd will identify the most optimal fingerprints to mitigate the attack. Once an attack is qualified, dosd will push a mitigation rule inline as an eBPF program to surgically drop the attack traffic. </p><p>The detection and mitigation of attacks by dosd is done at the server level, at the data center level and at the global level — and it’s all software defined. This makes our network extremely resilient and leads to almost instant mitigation. There are no out-of-path “scrubbing centers” or “scrubbing devices”. Instead, each server runs the full stack of the Cloudflare product suite including the DDoS detection and mitigation component. And it is all done autonomously. Each server also <i>gossips (multicasts)</i> mitigation instructions within a data center between servers, and globally between data centers. This ensures that whether an attack is localized or globally distributed, dosd will have already installed mitigation rules inline to ensure a robust mitigation.</p>
    <div>
      <h2>Strong defenses against strong attacks</h2>
      <a href="#strong-defenses-against-strong-attacks">
        
      </a>
    </div>
    <p>Our software-defined, autonomous DDoS detection and mitigation systems run across our entire network. In this post we focused mainly on our dynamic fingerprinting capabilities, but our arsenal of defense systems is much larger. The <a href="https://developers.cloudflare.com/ddos-protection/tcp-protection/"><u>Advanced TCP Protection</u></a> system and <a href="https://developers.cloudflare.com/ddos-protection/dns-protection/"><u>Advanced DNS Protection</u></a> system work alongside our dynamic fingerprinting to identify sophisticated and highly randomized TCP-based DDoS attacks and also leverages statistical analysis to thwart complex DNS-based DDoS attacks. Our defenses also incorporate real-time threat intelligence, traffic profiling, and machine learning classification as part of our <a href="https://developers.cloudflare.com/ddos-protection/managed-rulesets/adaptive-protection/"><u>Adaptive DDoS Protection</u></a> to mitigate traffic anomalies. </p><p>Together, these systems, alongside the full breadth of the Cloudflare Security portfolio, are built atop of the Cloudflare network — one of the largest networks in the world — to ensure our customers are protected from the largest attacks in the world.</p> ]]></content:encoded>
            <category><![CDATA[DDoS]]></category>
            <category><![CDATA[Attacks]]></category>
            <category><![CDATA[Trends]]></category>
            <category><![CDATA[Security]]></category>
            <guid isPermaLink="false">4j6QWqeVFn6qzs0Md0LK7h</guid>
            <dc:creator>Manish Arora</dc:creator>
            <dc:creator>Shawn Bohrer</dc:creator>
            <dc:creator>Omer Yoachimik</dc:creator>
            <dc:creator>Cody Doucette</dc:creator>
            <dc:creator>Alex Forster</dc:creator>
            <dc:creator>Nick Wood</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare incident on June 20, 2024]]></title>
            <link>https://blog.cloudflare.com/cloudflare-incident-on-june-20-2024/</link>
            <pubDate>Wed, 26 Jun 2024 13:00:22 GMT</pubDate>
            <description><![CDATA[ A new DDoS rule resulted in an increase in error responses and latency for Cloudflare customers. Here’s how it went wrong, and what we’ve learned ]]></description>
            <content:encoded><![CDATA[ <p></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/18peGsB3IdmJIUOoqJalSs/b69735394144edb57ba12ff8e8516518/2459.png" />
            
            </figure><p>On Thursday, June 20, 2024, two independent events caused an increase in latency and error rates for Internet properties and Cloudflare services that lasted 114 minutes. During the 30-minute peak of the impact, we saw that 1.4 - 2.1% of HTTP requests to our CDN received a generic error page, and observed a 3x increase for the 99th percentile Time To First Byte (TTFB) latency.</p><p>These events occurred because:</p><ol><li><p><a href="https://www.cloudflare.com/network-services/solutions/network-monitoring-tools/">Automated network monitoring</a> detected performance degradation, re-routing traffic suboptimally and <a href="https://www.cloudflarestatus.com/incidents/k7d4c79c63lq">causing backbone congestion between 17:33 and 17:50 UTC</a></p></li><li><p>A new Distributed Denial-of-Service (DDoS) mitigation mechanism deployed between 14:14 and 17:06 UTC triggered a latent bug in our rate limiting system that allowed a specific form of HTTP request to cause a process handling it to enter an infinite loop <a href="https://www.cloudflarestatus.com/incidents/p7l6rrbhysck">between 17:47 and 19:27 UTC</a></p></li></ol><p>Impact from these events were observed in many Cloudflare data centers around the world.</p><p>With respect to the backbone congestion event, we were already working on expanding backbone capacity in the affected data centers, and improving our network mitigations to use more information about the available capacity on alternative network paths when taking action. In the remainder of this blog post, we will go into more detail on the second and more impactful of these events.</p><p>As part of routine updates to our protection mechanisms, we created a new DDoS rule to prevent a specific type of abuse that we observed on our infrastructure. This DDoS rule worked as expected, however in a specific suspect traffic case it exposed a latent bug in our existing rate-limiting component. To be absolutely clear, we have no reason to believe this suspect traffic was intentionally exploiting this bug, and there is no evidence of a breach of any kind.</p><p>We are sorry for the impact and have already made changes to help prevent these problems from occurring again.</p>
    <div>
      <h2>Background</h2>
      <a href="#background">
        
      </a>
    </div>
    
    <div>
      <h3>Rate-limiting suspicious traffic</h3>
      <a href="#rate-limiting-suspicious-traffic">
        
      </a>
    </div>
    <p>Depending on the profile of an HTTP request and the configuration of the requested Internet property, Cloudflare may protect our network and our customer’s origins by applying a limit to the number of requests a visitor can make within a certain time window. These <a href="https://www.cloudflare.com/en-gb/learning/bots/what-is-rate-limiting/">rate limits</a> can activate through customer configuration or in response to DDoS rules detecting suspicious activity.</p><p>Usually, these rate limits will be applied based on the IP address of the visitor. As many institutions and Internet Service Providers (ISPs) can have <a href="https://en.wikipedia.org/wiki/Carrier-grade_NAT">many devices and individual users behind a single IP address</a>, rate limiting based on the IP address is a broad brush that can unintentionally block legitimate traffic.</p>
    <div>
      <h3>Balancing traffic across our network</h3>
      <a href="#balancing-traffic-across-our-network">
        
      </a>
    </div>
    <p>Cloudflare has several systems that together provide continuous real-time capacity monitoring and rebalancing to ensure we serve as much traffic as we can as quickly and efficiently as we can.</p><p>The first of these is <a href="/unimog-cloudflares-edge-load-balancer">Unimog, Cloudflare’s edge load balancer</a>. Every packet that reaches our anycast network passes through Unimog, which delivers it to an appropriate server to process that packet. That server may be in a different location from where the packet originally arrived into our network, depending on the availability of compute capacity. Within each data center, Unimog aims to keep the CPU load uniform across all active servers.</p><p>For a global view of our network, we rely on <a href="/meet-traffic-manager">Traffic Manager</a>. Across all of our data center locations, it takes in a variety of signals, such as overall CPU utilization, HTTP request latency, and bandwidth utilization to instruct rebalancing decisions. It has built-in safety limits to prevent causing outsized traffic shifts, and also considers the expected resulting load in destination locations when making any decisions.</p>
    <div>
      <h2>Incident timeline and impact</h2>
      <a href="#incident-timeline-and-impact">
        
      </a>
    </div>
    <p>All timestamps are UTC on 2024-06-20.</p><ul><li><p>14:14 DDoS rule gradual deployment starts</p></li><li><p>17:06 DDoS rule deployed globally</p></li><li><p>17:47 First HTTP request handling process is poisoned</p></li><li><p>18:04 Incident declared automatically based on detected high CPU load</p></li><li><p>18:34 Service restart shown to recover on a server, full restart tested in one data center</p></li><li><p>18:44 CPU load normalized in data center after service restart</p></li><li><p>18:51 Continual global reloads of all servers with many stuck processes begin</p></li><li><p>19:05 Global eyeball HTTP error rate peaks at 2.1% service unavailable / 3.45% total</p></li><li><p>19:05 First Traffic Manager actions recovering service</p></li><li><p>19:11 Global eyeball HTTP error rate halved to 1% service unavailable / 1.96% total</p></li><li><p>19:27 Global eyeball HTTP error rate reduced to baseline levels</p></li><li><p>19:29 DDoS rule deployment identified as likely cause of process poisoning</p></li><li><p>19:34 DDoS rule is fully disabled</p></li><li><p>19:43 Engineers stop routine restarts of services on servers with many stuck processes</p></li><li><p>20:16 Incident response stood down</p></li></ul><p>Below, we provide a view of the impact from some of Cloudflare’s internal metrics. The first graph illustrates the percentage of all eyeball (inbound from external devices) HTTP requests that were served an error response because the service suffering poisoning could not be reached. We saw an initial increase to 0.5% of requests, and then later a larger one reaching as much as 2.1% before recovery started due to our service reloads.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1EoCaNBt1Bss8RhwKO5s5B/155382a7f8eba337c39f48c803c9979b/image7-3.png" />
            
            </figure><p>For a broader view of errors, we can see all 5xx responses our network returned to eyeballs during the same window, including those from origin servers. These peaked at 3.45%, and you can more clearly see the gradual recovery between 19:25 and 20:00 UTC as Traffic Manager finished its re-routing activities. The dip at 19:25 UTC aligns with the last large reload, with the error increase afterwards primarily consisting of upstream DNS timeouts and connection limits which are consistent with high and unbalanced load.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7G1ZnlpW9Qbw8DgW5MfsLv/9758cb94e7d6be79dcfac41e482114ea/image4-6.png" />
            
            </figure><p>And here’s what our TTFB measurements looked like at the 50th, 90th and 99th percentiles, showing an almost 3x increase in latency at p99:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/16tMNhSZdhkV3wH6MtAWd6/44a638b8f639d39026112c32cb80dc2e/image2-10.png" />
            
            </figure>
    <div>
      <h2>Technical description of the error and how it happened</h2>
      <a href="#technical-description-of-the-error-and-how-it-happened">
        
      </a>
    </div>
    
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/MQYpmg1O82vEURJNsl2VU/da0b8e5c1afd70998bc928a533ee4160/image5-5.png" />
            
            </figure><p><i>Global percentage of HTTP Request handling processes that were using excessive CPU during the event</i></p><p>Earlier on June 20, between 14:14 - 17:06 UTC, we gradually activated a new DDoS rule on our network. Cloudflare has recently been building a new way of mitigating HTTP DDoS attacks. This method is using a combination of rate-limits and cookies in order to allow legitimate clients that were falsely identified as being part of an attack to proceed anyway.</p><p>With this new method, an HTTP request that is considered suspicious runs through these key steps:</p><ol><li><p>Check for the presence of a valid cookie, otherwise block the request</p></li><li><p>If a valid cookie is found, add a rate-limit rule based on the cookie value to be evaluated at a later point</p></li><li><p>Once all the currently applied DDoS mitigation are run, apply rate-limit rules</p></li></ol><p>We use this "asynchronous" workflow because it is more efficient to block a request without a rate-limit rule, so it gives a chance for other rule types to be applied.</p><p>So overall, the flow can be summarized with this pseudocode:</p>
            <pre><code>for (rule in active_mitigations) {
   // ... (ignore other rule types)
   if (rule.match_current_request()) {
       if (!has_valid_cookie()) {
           // no cookie: serve error page
           return serve_error_page();
       } else {
           // add a rate-limit rule to be evaluated later
           add_rate_limit_rule(rule);
       }
   }
}


evaluate_rate_limit_rules();</code></pre>
            <p>When evaluating rate-limit rules, we need to make a <i>key</i> for each client that is used to look up the correct counter and compare it with the target rate. Typically, this key is the client IP address, but other options are available, such as the value of a cookie as used here. We actually reused an existing portion of the rate-limit logic to achieve this. In pseudocode, it looks like:</p>
            <pre><code>function get_cookie_key() {
   // Validate that the cookie is valid before taking its value.
   // Here the cookie has been checked before already, but this code is
   // also used for "standalone" rate-limit rules.
   if (!has_valid_cookie_broken()) { // more on the "broken" part later
       return cookie_value;
   } else {
       return parent_key_generator();
   }
}</code></pre>
            <p>This simple <i>key</i> generation function had two issues that, combined with a specific form of client request, caused an infinite loop in the process handling the HTTP request:</p><ol><li><p>The rate-limit rules generated by the DDoS logic are using internal APIs in ways that haven't been anticipated. This caused the <code>parent_key_generator</code> in the pseudocode above to point to the <code>get_cookie_key</code> function itself, meaning that if that code path was taken, the function would call itself indefinitely</p></li><li><p>As these rate-limit rules are added only after validating the cookie, validating it a second time should give the same result. The problem is that the <code>has_valid_cookie_broken</code> function used here is actually different and both can disagree if the client sends multiple cookies where some are valid but not others</p></li></ol><p>So, combining these two issues: the broken validation function tells <code>get_cookie_key</code> that the cookie is invalid, causing the <code>else</code> branch to be taken and calling the same function over and over.</p><p>A protection many programming languages have in place to help prevent loops like this is a run-time protection limit on how deep the stack of function calls can get. An attempt to call a function once already at this limit will result in a runtime error. When reading the logic above, an initial analysis might suggest we were reaching the limit in this case, and so requests eventually resulted in an error, with a stack containing those same function calls over and over.</p><p>However, this isn’t the case here. Some languages, including Lua, in which this logic is written, also implement an optimization called proper tail calls. A tail call is when the final action a function takes is to execute another function. Instead of adding that function as another layer in the stack, as we know for sure that we will not be returning execution context to the parent function afterwards, nor using any of its local variables, we can replace the top frame in the stack with this function call instead.</p><p>The end result is a loop in the request processing logic which never increases the size of the stack. Instead, it simply consumes 100% of available CPU resources, and never terminates. Once a process handling HTTP requests receives a single request on which the action should be applied and has a mixture of valid and invalid cookies, that process is poisoned and is never able to process any further requests.</p><p>Every Cloudflare server has dozens of such processes, so a single poisoned process does not have much of an impact. However, then some other things start happening:</p><ol><li><p>The increase in CPU utilization for the server causes Unimog to lower the amount of new traffic that server receives, moving traffic to other servers, so at a certain point, more new connections are directed away from servers with a subset of their processes poisoned to those with fewer or no poisoned processes, and therefore lower CPU utilization.</p></li><li><p>The gradual increase in CPU utilization in the data center starts to cause Traffic Manager to redirect traffic to other data centers. As this movement does not fix the poisoned processes, CPU utilization remains high, and so Traffic Manager continues to redirect more and more traffic away.</p></li><li><p>The redirected traffic in both cases includes the requests that are poisoning processes, causing the servers and data centers to which this redirected traffic was sent to start failing in the same way.</p></li></ol><p>Within a few minutes, multiple data centers had many poisoned processes, and Traffic Manager had redirected as much traffic away from them as possible, but was restricted from doing more. This was partly due to its built-in automation safety limits, but also because it was becoming more difficult to find a data center with sufficient available capacity to use as a target.</p><p>The first case of a poisoned process was at 17:47 UTC, and by 18:09 UTC – five minutes after the incident was declared – Traffic Manager was re-routing a lot of traffic out of Europe:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2AVE8fJsh1ODNjAoAtduon/6d77ac4385ba78ddd251c887ef02b74a/image3-14.png" />
            
            </figure><p><i>A summary map of Traffic Manager capacity actions as of 18:09 UTC. Each circle represents a data center that traffic is being re-routed towards or away from. The color of the circle indicates the CPU load of that data center. The orange ribbons between them show how much traffic is re-routed, and where from/to.</i></p><p>It’s obvious to see why, if we look at the percentage of the HTTP request service’s processes that were saturating their CPUs. 10% of our capacity in Western Europe was already gone, and 4% in Eastern Europe, during peak traffic time for those timezones:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7A71NY1brim2rjGowoewXo/a1c7f316d465b7dfb6c844b14c6408c3/image1-21.png" />
            
            </figure><p><i>Percentage of all the HTTP request handling processes saturating their CPU, by geographic region</i></p><p>Partially poisoned servers in many locations struggled with the request load, and the remaining processes could not keep up, resulting in Cloudflare returning minimal HTTP error responses.</p><p>Cloudflare engineers were automatically notified at 18:04 UTC, once our global CPU utilization reached a certain sustained level, and started to investigate. Many of our on-duty incident responders were already working on the open incident caused by backbone network congestion, and in the early minutes we looked into likely correlation with the network congestion events. It took some time for us to realize that locations where the CPU was highest is where traffic was the lowest, drawing the investigation away from a network event being the trigger. At this point, the focus moved to two main streams:</p><ol><li><p>Evaluating if restarting poisoned processes allowed them to recover, and if so, instigating mass-restarts of the service on affected servers</p></li><li><p>Identifying the trigger of processes entering this CPU saturation state</p></li></ol><p>It was 25 minutes after the initial incident was declared when we validated that restarts helped on one sample server. Five minutes after this, we started executing wider restarts – initially to entire data centers at once, and then as the identification method was refined, on servers with a large number of poisoned processes. Some engineers continued regular routine restarts of the affected service on impacted servers, whilst others moved to join the ongoing parallel effort to identify the trigger. At 19:36 UTC, the new DDoS rule was disabled globally, and the incident was declared resolved after executing one more round of mass restarts and monitoring.</p><p>At the same time, conditions presented by the incident triggered a latent bug in Traffic Manager. When triggered, the system would attempt to recover from the exception by initiating a graceful restart, halting its activity. The bug was first triggered at 18:17 UTC, then numerous times between 18:35 and 18:57 UTC. During two periods in this window (18:35-18:52 UTC and 18:56-19:05 UTC) the system did not issue any new traffic routing actions. This meant whilst we had recovered service in the most affected data centers, almost all traffic was still being re-routed away from them. Alerting notified on-call engineers of the issue at 18:34 UTC. By 19:05 UTC the Traffic team had written, tested, and deployed a fix. The first actions following restoration showed a positive impact on restoring service.</p>
    <div>
      <h2>Remediation and follow-up steps</h2>
      <a href="#remediation-and-follow-up-steps">
        
      </a>
    </div>
    <p>To resolve the immediate impact to our network from the request poisoning, Cloudflare instigated mass rolling restarts of the affected service until the change that triggered the condition was identified and rolled back. The change, which was the activation of a new type of DDoS rule, remains fully rolled back, and the rule will not be reactivated until we have fixed the broken cookie validation check and are fully confident this situation cannot recur.</p><p>We take these incidents very seriously, and recognize the magnitude of impact they had. We have identified several steps we can take to address these specific situations, and the risk of these sorts of problems from recurring in the future.</p><ul><li><p><b>Design:</b> The rate limiting implementation in use for our DDoS module is a legacy component, and rate limiting rules customers configure for their Internet properties use a newer engine with more modern technologies and protections.</p></li><li><p><b>Design:</b> We are exploring options within and around the service which experienced process poisoning to limit the ability to loop forever through tail calls. Longer term, Cloudflare is entering the early implementation stages of replacing this service entirely. The design of this replacement service will allow us to apply limits on the non-interrupted and total execution time of a single request.</p></li><li><p><b>Process:</b> The activation of the new rule for the first time was staged in a handful of production data centers for validation, and then to all data centers a few hours later. We will continue to enhance our staging and rollout procedures to minimize the potential change-related blast radius.</p></li></ul>
    <div>
      <h2>Conclusion</h2>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>Cloudflare experienced two back-to-back incidents that affected a significant set of customers using our CDN and network services. The first was network backbone congestion that our systems automatically remediated. We mitigated the second by regularly restarting the faulty service whilst we identified and deactivated the DDoS rule that was triggering the fault. We are sorry for any disruption this caused our customers and to end users trying to access services.</p><p>The conditions necessary to activate the latent bug in the faulty service are no longer possible in our production environment, and we are putting further fixes and detections in place as soon as possible.</p> ]]></content:encoded>
            <category><![CDATA[Post Mortem]]></category>
            <category><![CDATA[Outage]]></category>
            <guid isPermaLink="false">1J7iIhkUBWQNj3JpbBTVEU</guid>
            <dc:creator>Lloyd Wallis</dc:creator>
            <dc:creator>Julien Desgats</dc:creator>
            <dc:creator>Manish Arora</dc:creator>
        </item>
    </channel>
</rss>