
<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>Tue, 14 Apr 2026 19:01:22 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Introducing Programmable Flow Protection: custom DDoS mitigation logic for Magic Transit customers]]></title>
            <link>https://blog.cloudflare.com/programmable-flow-protection/</link>
            <pubDate>Tue, 31 Mar 2026 13:00:00 GMT</pubDate>
            <description><![CDATA[ Magic Transit customers can now program their own DDoS mitigation logic and deploy it across Cloudflare’s global network. This enables precise, stateful mitigation for custom and proprietary UDP protocols. ]]></description>
            <content:encoded><![CDATA[ <p>We're proud to introduce <a href="https://developers.cloudflare.com/ddos-protection/advanced-ddos-systems/overview/programmable-flow-protection/"><u>Programmable Flow Protection</u></a>: a system designed to let <a href="https://www.cloudflare.com/network-services/products/magic-transit/"><u>Magic Transit</u></a> customers implement their own custom DDoS mitigation logic and deploy it across Cloudflare’s global network. This enables precise, stateful mitigation for custom and proprietary protocols built on UDP. It is engineered to provide the highest possible level of customization and flexibility to mitigate DDoS attacks of any scale. </p><p>Programmable Flow Protection is currently in beta and available to all Magic Transit Enterprise customers for an additional cost. Contact your account team to join the beta or sign up at <a href="https://www.cloudflare.com/en-gb/lp/programmable-flow-protection/"><u>this page</u></a>.</p>
    <div>
      <h3>Programmable Flow Protection is customizable</h3>
      <a href="#programmable-flow-protection-is-customizable">
        
      </a>
    </div>
    <p>Our existing <a href="https://www.cloudflare.com/ddos/"><u>DDoS mitigation systems</u></a> have been designed to understand and protect popular, well-known protocols from DDoS attacks. For example, our <a href="https://developers.cloudflare.com/ddos-protection/advanced-ddos-systems/overview/advanced-tcp-protection/"><u>Advanced TCP Protection</u></a> system uses specific known characteristics about the TCP protocol to issue challenges and establish a client’s legitimacy. Similarly, our <a href="https://blog.cloudflare.com/advanced-dns-protection/"><u>Advanced DNS Protection</u></a> builds a per-customer profile of DNS queries to mitigate DNS attacks. Our generic DDoS mitigation platform also understands common patterns across a variety of other well known protocols, including NTP, RDP, SIP, and many others.</p><p>However, custom or proprietary UDP protocols have always been a challenge for Cloudflare’s DDoS mitigation systems because our systems do not have the relevant protocol knowledge to make intelligent decisions to pass or drop traffic. </p><p>Programmable Flow Protection addresses this gap. Now, customers can write their own <a href="https://ebpf.io/"><u>eBPF</u></a> program that defines what “good” and “bad” packets are and how to deal with them. Cloudflare then runs the program across our entire global network. The program can choose to either drop or challenge “bad” packets, preventing them from reaching the customer’s origin. </p>
    <div>
      <h3>The problem of UDP-based attacks</h3>
      <a href="#the-problem-of-udp-based-attacks">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/learning/ddos/glossary/user-datagram-protocol-udp/"><u>UDP</u></a> is a connectionless transport layer protocol. Unlike TCP, UDP has no handshake or stateful connections. It does not promise that packets will arrive in order or exactly once. UDP instead prioritizes speed and simplicity, and is therefore well-suited for online gaming, VoIP, video streaming, and any other use case where the application requires real-time communication between clients and servers.</p><p>Our DDoS mitigation systems have always been able to detect and mitigate attacks against well-known protocols built on top of UDP. For example, the standard DNS protocol is built on UDP, and each DNS packet has a well-known structure. If we see a DNS packet, we know how to interpret it. That makes it easier for us to detect and drop DNS-based attacks. </p><p>Unfortunately, if we don’t understand the protocol inside a UDP packet’s payload, our DDoS mitigation systems have limited options available at mitigation time. If an attacker <a href="https://www.cloudflare.com/learning/ddos/udp-flood-ddos-attack/"><u>sends a large flood of UDP traffic</u></a> that does not match any known patterns or protocols, Cloudflare can either entirely block or apply a rate limit to the destination IP and port combination. This is a crude “last line of defense” that is only intended to keep the rest of the customer’s network online, and it can be painful in a couple ways. </p><p>First, a block or a generic <a href="https://www.cloudflare.com/learning/bots/what-is-rate-limiting/"><u>rate limit</u></a> does not distinguish good traffic from bad, which means these mitigations will likely cause legitimate clients to experience lag or connection loss — doing the attacker’s job for them! Second, a generic rate limit can be too strict or too lax depending on the customer. For example, a customer who expects to receive 1Gbps of legitimate traffic probably needs more aggressive rate limiting compared to a customer who expects to receive 25Gbps of legitimate traffic.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/L8PZ6eWn9nkpATaNcUinB/b6c12b4be815fbd4e71166b6f0c30329/BLOG-3182_2.png" />
          </figure><p><sup><i>An illustration of UDP packet contents. A user can define a valid payload and reject traffic that doesn’t match the defined pattern.</i></sup></p><p>The Programmable Flow Protection platform was built to address this problem by allowing our customers to dictate what “good” versus “bad” traffic actually looks like. Many of our customers use custom or proprietary UDP protocols that we do not understand — and now we don’t have to.</p>
    <div>
      <h3>How Programmable Flow Protection works</h3>
      <a href="#how-programmable-flow-protection-works">
        
      </a>
    </div>
    <p>In previous blog posts, we’ve described how “flowtrackd”, our <a href="https://blog.cloudflare.com/announcing-flowtrackd/"><u>stateful network layer DDoS mitigation system</u></a>, protects Magic Transit users from complex TCP and DNS attacks. We’ve also described how we use Linux technologies like <a href="https://blog.cloudflare.com/l4drop-xdp-ebpf-based-ddos-mitigations/"><u>XDP</u></a> and <a href="https://blog.cloudflare.com/cloudflare-architecture-and-how-bpf-eats-the-world/"><u>eBPF</u></a> to efficiently mitigate common types of large scale DDoS attacks. </p><p>Programmable Flow Protection combines these technologies in a novel way. With Programmable Flow Protection, a customer can write their own eBPF program that decides whether to pass, drop, or challenge individual packets based on arbitrary logic. A customer can upload the program to Cloudflare, and Cloudflare will execute it on every packet destined to their network. Programs are executed in userspace, not kernel space, which allows Cloudflare the flexibility to support a variety of customers and use cases on the platform without compromising security. Programmable Flow Protection programs run after all of Cloudflare’s existing DDoS mitigations, so users still benefit from our standard security protections. </p><p>There are many similarities between an XDP eBPF program loaded into the Linux kernel and an eBPF program running on the Programmable Flow Protection platform. Both types of programs are compiled down to BPF bytecode. They are both run through a “verifier” to ensure memory safety and verify program termination. They are also executed in a fast, lightweight VM to provide isolation and stability.</p><p>However, eBPF programs loaded into the Linux kernel make use of many Linux-specific “helper functions” to integrate with the network stack, maintain state between program executions, and emit packets to network devices. Programmable Flow Protection offers the same functionality whenever a customer chooses, but with a different API tailored specifically to implement DDoS mitigations. For example, we’ve built helper functions to store state about clients between program executions, perform cryptographic validation, and emit challenge packets to clients. With these helper functions, a developer can use the power of the Cloudflare platform to protect their own network.</p>
    <div>
      <h3>Combining customer knowledge with Cloudflare’s network</h3>
      <a href="#combining-customer-knowledge-with-cloudflares-network">
        
      </a>
    </div>
    <p>Let’s step through an example to illustrate how a customer’s protocol-specific knowledge can be combined with Cloudflare’s network to create powerful mitigations.</p><p>Say a customer hosts an online gaming server on UDP port 207. The game engine uses a proprietary application header that is specific to the game. Cloudflare has no knowledge of the structure or contents of the application header. The customer gets hit by DDoS attacks that overwhelm the game server and players report lag in gameplay. The attack traffic comes from highly randomized source IPs and ports, and the payload data appears to be random as well. </p><p>To mitigate the attack, the customer can use their knowledge of the application header and deploy a Programmable Flow Protection program to check a packet’s validity. In this example, the application header contains a token that is unique to the gaming protocol. The customer can therefore write a program to extract the last byte of the token. The program passes all packets with the correct value present and drops all other traffic:</p>
            <pre><code>#include &lt;linux/ip.h&gt;
#include &lt;linux/udp.h&gt;
#include &lt;arpa/inet.h&gt;

#include "cf_ebpf_defs.h"
#include "cf_ebpf_helper.h"

// Custom application header
struct apphdr {
    uint8_t  version;
    uint16_t length;   // Length of the variable-length token
    uint8_t  token[0]; // Variable-length token
} __attribute__((packed));

uint64_t
cf_ebpf_main(void *state)
{
    struct cf_ebpf_generic_ctx *ctx = state;
    struct cf_ebpf_parsed_headers headers;
    struct cf_ebpf_packet_data *p;

    // Parse the packet headers with provided helper function
    if (parse_packet_data(ctx, &amp;p, &amp;headers) != 0) {
        return CF_EBPF_DROP;
    }

    // Drop packets not destined to port 207
    struct udphdr *udp_hdr = (struct udphdr *)headers.udp;
    if (ntohs(udp_hdr-&gt;dest) != 207) {
        return CF_EBPF_DROP;
    }

    // Get application header from UDP payload
    struct apphdr *app = (struct apphdr *)(udp_hdr + 1);
    if ((uint8_t *)(app + 1) &gt; headers.data_end) {
        return CF_EBPF_DROP;
    }

    // Perform memory checks to satisfy the verifier
    // and access the token safely
    if ((uint8_t *)(app-&gt;token + token_len) &gt; headers.data_end) {
        return CF_EBPF_DROP;
    }

    // Check the last byte of the token against expected value
    uint8_t *last_byte = app-&gt;token + token_len - 1;
    if (*last_byte != 0xCF) {
        return CF_EBPF_DROP;
    }

    return CF_EBPF_PASS;
}</code></pre>
            <p><sup><i>An eBPF program to filter packets according to a value in the application header.</i></sup></p><p>This program leverages application-specific information to create a more targeted mitigation than Cloudflare is capable of crafting on its own. <b>Customers can now combine their proprietary knowledge with the capacity of Cloudflare’s global network to absorb and mitigate massive attacks better than ever before.</b></p>
    <div>
      <h3>Going beyond firewalls: stateful tracking and challenges</h3>
      <a href="#going-beyond-firewalls-stateful-tracking-and-challenges">
        
      </a>
    </div>
    <p>Many pattern checks, like the one performed in the example above, can be accomplished with traditional firewalls. However, programs provide useful primitives that are not available in firewalls, including variables, conditional execution, loops, and procedure calls. But what really sets Programmable Flow Protection apart from other solutions is its ability to statefully track flows and challenge clients to prove they are real. A common type of attack that showcases these abilities is a <i>replay attack</i>.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6Pgo9uUQDY1GTrxAOAOgiK/52c6d6a329cce05ff11ba3e4694313b2/BLOG-3182_3.png" />
          </figure><p>In a replay attack, an attacker repeatedly sends packets that were valid at <i>some</i> point, and therefore conform to expected patterns of the traffic, but are no longer valid in the application’s current context. For example, the attacker could record some of their valid gameplay traffic and use a script to duplicate and transmit the same traffic at a very high rate.</p><p>With Programmable Flow Protection, a user can deploy a program that challenges suspicious clients and drops scripted traffic. We can extend our original example as follows:</p>
            <pre><code>
#include &lt;linux/ip.h&gt;
#include &lt;linux/udp.h&gt;
#include &lt;arpa/inet.h&gt;

#include "cf_ebpf_defs.h"
#include "cf_ebpf_helper.h"

uint64_t
cf_ebpf_main(void *state)
{
    // ...
 
    // Get the status of this source IP (statefully tracked)
    uint8_t status;
    if (cf_ebpf_get_source_ip_status(&amp;status) != 0) {
        return CF_EBPF_DROP;
    }

    switch (status) {
        case NONE:
		// Issue a custom challenge to this source IP
             issue_challenge();
             cf_ebpf_set_source_ip_status(CHALLENGED);
             return CF_EBPF_DROP;


        case CHALLENGED:
		// Check if this packet passes the challenge
		// with custom logic
             if (verify_challenge()) {
                 cf_ebpf_set_source_ip_status(VERIFIED);
                 return CF_EBPF_PASS;
             } else {
                 cf_ebpf_set_source_ip_status(BLOCKED);
                 return CF_EBPF_DROP;
             }


        case VERIFIED:
		// This source IP has passed the challenge
		return CF_EBPF_PASS;

	 case BLOCKED:
		// This source IP has been blocked
		return CF_EBPF_DROP;

        default:
            return CF_EBPF_PASS;
    }


    return CF_EBPF_PASS;
}
</code></pre>
            <p><sup><i>An eBPF program to challenge UDP connections and statefully manage connections. This example has been simplified for illustration purposes.</i></sup></p><p>The program statefully tracks the source IP addresses it has seen and emits a packet with a cryptographic challenge back to unknown clients. A legitimate client running a valid gaming client is able to correctly solve the challenge and respond with proof, but the attacker’s script is not. Traffic from the attacker is marked as “blocked” and subsequent packets are dropped.</p><p>With these new abilities, customers can statefully track flows and make sure only real, verified clients can send traffic to their origin servers. Although we have focused the example on gaming, the potential use cases for this technology extend to any UDP-based protocol.</p>
    <div>
      <h3>Get started today</h3>
      <a href="#get-started-today">
        
      </a>
    </div>
    <p>We’re excited to offer the Programmable Flow Protection feature to Magic Transit Enterprise customers. Talk to your account manager to learn more about how you can enable Programmable Flow Protection to help keep your infrastructure safe.</p><p>We’re still in active development of the platform, and we’re excited to see what our users build next. If you are not yet a Cloudflare customer, let us know if you’d like to protect your network with Cloudflare and Programmable Flow Protection by signing up at this page: <a href="https://www.cloudflare.com/lp/programmable-flow-protection/"><u>https://www.cloudflare.com/lp/programmable-flow-protection/</u></a>.</p> ]]></content:encoded>
            <category><![CDATA[Beta]]></category>
            <category><![CDATA[DDoS]]></category>
            <category><![CDATA[UDP]]></category>
            <category><![CDATA[eBPF]]></category>
            <category><![CDATA[Magic Transit]]></category>
            <category><![CDATA[Network Services]]></category>
            <guid isPermaLink="false">64lPEfE3ML34AycHER46Tz</guid>
            <dc:creator>Anita Tenjarla</dc:creator>
            <dc:creator>Alex Forster</dc:creator>
            <dc:creator>Cody Doucette</dc:creator>
            <dc:creator>Venus Xeon-Blonde</dc:creator>
        </item>
        <item>
            <title><![CDATA[Cloudflare now supports security keys with Web Authentication (WebAuthn)!]]></title>
            <link>https://blog.cloudflare.com/cloudflare-now-supports-security-keys-with-web-authentication-webauthn/</link>
            <pubDate>Wed, 01 Apr 2020 10:00:00 GMT</pubDate>
            <description><![CDATA[ We’re excited to announce that Cloudflare now supports security keys as a two factor authentication (2FA) method for all users. ]]></description>
            <content:encoded><![CDATA[ <p></p><p>We’re excited to announce that Cloudflare now supports security keys as a two factor authentication (2FA) method for all users. Cloudflare customers now have the ability to use security keys on WebAuthn-supported browsers to log into their user accounts. We strongly suggest users configure multiple security keys and 2FA methods on their account in order to access their apps from various devices and browsers. If you want to get started with security keys, visit your <a href="https://dash.cloudflare.com/profile/authentication">account's 2FA settings</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4vAImWKYh5Uk9bPpBvrpXB/7a83d050b565a65189f55c348fb940f4/image4-5.png" />
            
            </figure>
    <div>
      <h3>What is WebAuthn?</h3>
      <a href="#what-is-webauthn">
        
      </a>
    </div>
    <p>WebAuthn is a standardized protocol for authentication online using public key cryptography. It is part of the <a href="https://fidoalliance.org/fido2/">FIDO2 Project</a> and is backwards compatible with <a href="https://fidoalliance.org/specs/u2f-specs-master/fido-u2f-overview.html">FIDO U2F</a>. Depending on your device and browser, you can use hardware security keys (like YubiKeys) or built-in biometric support (like Apple Touch ID) to authenticate to your Cloudflare user account as a second factor. WebAuthn support is rapidly increasing among browsers and devices, and we’re proud to join the growing list of services that offer this feature.</p><p>To use WebAuthn, a user registers their security key, or “authenticator”, to a supporting application, or “relying party” (in this case Cloudflare). The authenticator then generates and securely stores a public/private keypair on the device. The keypair is scoped to a specific domain and user account. The authenticator then sends the public key to the relying party, who stores it. A user may have multiple authenticators registered with the same relying party. In fact, it’s strongly encouraged for a user to do so in case an authenticator is lost or broken.</p><p>When a user logs into their account, the relying party will issue a randomly generated byte sequence called a “challenge”. The authenticator will prompt the user for “interaction” in the form of a tap, touch or PIN before signing the challenge with the stored private key and sending it back to the relying party. The relying party evaluates the signed challenge against the public key(s) it has stored associated with the user, and if the math adds up the user is authenticated! To learn more about how WebAuthn works, take a look at the <a href="https://www.w3.org/TR/webauthn/">official documentation</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4L8QDPgAVr53H9z1jKAFpj/c197e2548c99eab2a6067c9168ad8779/image1-9.png" />
            
            </figure>
    <div>
      <h3>How is WebAuthn different from other 2FA methods?</h3>
      <a href="#how-is-webauthn-different-from-other-2fa-methods">
        
      </a>
    </div>
    <p>There’s a lot of hype about WebAuthn, and rightfully so. But there are some common misconceptions about how WebAuthn actually works, so I wanted to take some time to explain why it’s so effective against various credential-based attacks.</p><p>First, WebAuthn relies on a “physical thing you have” rather than an app or a phone number, which makes it a lot harder for a remote attacker to impersonate a victim. This assumption prevents common exploits like <a href="https://en.wikipedia.org/wiki/SIM_swap_scam">SIM swapping</a>, which is an attack used to bypass SMS-based verification. In contrast, an attacker physically (and cryptographically) cannot “impersonate” a hardware security key unless they have physical access to a victim’s unlocked device.</p><p>WebAuthn is also simpler and quicker to use compared to mobile app-based 2FA methods. Users often complain about the amount of time it takes to reach for their phone, open an app, and copy over an expiring passcode every time they want to log into an account. By contrast, security keys require a simple touch or tap on a piece of hardware that’s often attached to a device.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7BzeMwB9JcpgfX6SX6Nne2/a5b94bfc490cb0f7d316f98a20a8a1db/safari-3.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2fHUDj64Hd7BO5dAWnnvAZ/e9c05d5df5f9c43a8bb0206c2fe2f00f/brave-3.png" />
            
            </figure>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7KAtwJGdQeWCuAbEHpAaOy/535cba4dee2bc0b725468a8d20644ac1/chrome-3.png" />
            
            </figure><p>Safari | Brave | Chrome for Android</p><p>But where WebAuthn really shines is its particular resistance to phishing attacks. Phishing often requires an attacker to construct a believable fake replica of a target site. For example, an attacker could try to register cloudfare[.]com (notice the typo!) and construct a site that looks similar to the genuine cloudflare[.]com. The attacker might then try to trick a victim into logging into the fake site and disclosing their credentials. Even if the victim has mobile app <a href="https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm">TOTP</a> authentication enabled, a sophisticated attacker can still proxy requests from the fake site to the genuine site and successfully authenticate as the victim. This is the assumption behind powerful on-path attacker tools like <a href="https://github.com/kgretzky/evilginx2">evilginx</a>.</p><p>WebAuthn prevents users from falling victim to common phishing and on-path attacker attacks because it takes the domain name into consideration when creating user credentials. When an authenticator creates the public/private keypair, it is specifically scoped to a particular account and domain. So let’s say a user with WebAuthn configured navigates to the phishy cloudfare[.]com site. When the phishy site prompts the authenticator to sign its challenge, the authenticator will attempt to find credentials for that phishy site’s domain and, upon failing to find any, will error and prevent the user from logging in. This is why hardware security keys are among the most secure authentication methods in existence today according to <a href="https://security.googleblog.com/2019/05/new-research-how-effective-is-basic.html">research by Google</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3Iom6CZFFZR5OES51LHkOQ/6f7facb3f7c22d24f49098d86236f6f9/image3-4.png" />
            
            </figure><p>WebAuthn also has <a href="https://www.w3.org/TR/webauthn/#sctn-privacy-considerations">very strict privacy guarantees</a>.  If a user authenticates with a biometric key (like Apple TouchID or Windows Hello), the relying party never receives any of that biometric data. The communication between authenticator and client browser is completely separate from the communication between client browser and relying party. WebAuthn also urges relying parties to not disclose user-identifiable information (like email addresses) during registration or authentication. This helps prevent replay or user enumeration attacks. And because credentials are strictly scoped to a particular relying party and domain, a malicious relying party won’t be able to gain information about other relying parties an authenticator has created credentials for in order to track a user’s various accounts.</p><p>Finally, WebAuthn is great for relying parties because they don’t have to store anything additionally sensitive about a user. The relying party simply stores a user’s public key. An attacker who gains access to the public key can’t do much with it because they won’t know the associated private key. This is markedly less risky than TOTP, where a relying party must use proper hygiene to store a TOTP secret seed from which all subsequent time-based user passcodes are generated.</p>
    <div>
      <h3>Security isn’t always intuitive</h3>
      <a href="#security-isnt-always-intuitive">
        
      </a>
    </div>
    <p>Sometimes in the security industry we have the tendency to fixate on new and sophisticated attacks. But often it’s the same old “simple” problems that have the <a href="https://www.rapid7.com/research/report/under-the-hoodie-2019/">highest impact</a>. Two factor authentication is a textbook case where the security industry largely believes a concept is trivial, but the average user still finds it confusing or annoying. WebAuthn addresses this problem because it’s quicker and more secure for the end user compared to other authentication methods. We think the trend towards security key adoption will continue to grow, and we’re looking forward to doing our part to help the effort.</p><p><i>Note: If you login to your Cloudflare user account with Single Sign-On (SSO), you will not have the option to use two factor authentication (2FA). This is because your SSO provider manages your 2FA methods. To learn more about Cloudflare’s 2FA offerings, please visit our</i> <a href="https://support.cloudflare.com/hc/en-us/articles/200167906"><i>support center</i></a><i>.</i></p> ]]></content:encoded>
            <category><![CDATA[Security]]></category>
            <category><![CDATA[Product News]]></category>
            <guid isPermaLink="false">727bSikJc4bQoKcIvnF5uZ</guid>
            <dc:creator>Anita Tenjarla</dc:creator>
        </item>
    </channel>
</rss>