Note: articles are for educational purposes and are not professional security advice — consult an expert for your specific needs.

Cloudflare security flaw: Bypass via its own infrastructure

In short

Cloudflare’s shared origin authentication certificate and IP allowlisting let attackers route traffic through Cloudflare to bypass DDoS and firewall protections. Affected configurations use Authenticated Origin Pulls or Allowlist Cloudflare IP Addresses; defenses are custom SSL/TLS certificates and, if available, Cloudflare Aegis with specific egress IP ranges.

Summary written with AI from this article, and checked against it.

Irony in Cybersecurity: Cloudflare's Protections Bypassed Using Its Own System

Affected systems and impact

FlawAffected systemsImpact
Shared authentication certificate accepts connections from other Cloudflare customersCloudflare Authenticated Origin Pulls using the shared SSL/TLS certificateAttackers route malicious traffic through Cloudflare to bypass origin protections
IP allowlisting trusts traffic from other Cloudflare customersOrigin servers using Allowlist Cloudflare IP AddressesMalicious traffic routed through Cloudflare appears legitimate and bypasses origin protections

A notable irony in cybersecurity has emerged with Cloudflare's own DDoS prevention and Firewall mechanisms being susceptible to exploitation using Cloudflare's infrastructure. Researchers from Certitude discovered a method that bypasses Cloudflare’s security measures, potentially imposing a significant burden on its clients.

Technical Details of the Vulnerability

The vulnerability affects two critical aspects of Cloudflare's system: "Authenticated Origin Pulls" and "Allowlist Cloudflare IP Addresses."

Authenticated Origin Pulls

Cloudflare's "Authenticated Origin Pulls" is a security feature designed to validate HTTP(s) requests to an origin server. The SSL/TLS certificate used for authentication between Cloudflare's reverse proxies and a customer's origin server is critical in preventing unauthorized access. However, Cloudflare utilizes a shared certificate for all customers, not tenant-specific ones, which allows connections from Cloudflare to be universally accepted. Attackers can exploit this by creating a custom domain on Cloudflare, pointing its DNS A record to the victim's IP address, disabling certain protection features, and launching attacks through Cloudflare’s infrastructure.

Allowlist Cloudflare IP Addresses

This feature permits traffic only from Cloudflare's IP range to reach clients' origin servers. Attackers can set up a domain with Cloudflare, point the domain's DNS A record to the target victim’s server IP, disable protection features, and route malicious traffic through Cloudflare. As a result, the traffic appears legitimate from the victim’s perspective.

Recommendations for Defense

Certitude suggests the following measures against these vulnerabilities:

  1. Use a Custom SSL/TLS Certificate: Instead of relying on Cloudflare's shared certificate, customers should configure the "Authenticated Origin Pulls" feature using their own custom SSL/TLS certificates. This approach ensures domain-specific authentication, thus reducing the risk of impersonation and bypassing security protections.
  2. Utilize Cloudflare Aegis for Specific Egress IP Ranges: If available, customers should use Cloudflare Aegis to define a more specific egress IP address range tailored to their needs. This can help in enhancing security by limiting the IP addresses allowed to connect to the customer's origin servers.

Conclusion

The discovery of logic flaws in Cloudflare's security measures highlights the complexities of cybersecurity and the need for continuous vigilance and adaptation. While Cloudflare's infrastructure provides robust security in many aspects, attackers’ ability to exploit shared components for malicious purposes necessitates additional defensive strategies.

Quick revision

Interview flashcards

  1. Which two Cloudflare security features are affected by the bypass vulnerability?

    The vulnerability affects Authenticated Origin Pulls and Allowlist Cloudflare IP Addresses. Attackers can exploit these features using Cloudflare's own infrastructure.

  2. What is Authenticated Origin Pulls designed to validate?

    Authenticated Origin Pulls validates HTTP(s) requests to an origin server. It uses an SSL/TLS certificate to authenticate connections between Cloudflare's reverse proxies and the customer's origin server.

  3. Why does Cloudflare's shared certificate create a weakness in Authenticated Origin Pulls?

    Cloudflare uses a shared certificate for all customers rather than tenant-specific certificates. This allows connections from Cloudflare to be universally accepted, enabling attackers to exploit that trust.

  4. How can an attacker use Cloudflare's infrastructure to bypass a victim's protections?

    An attacker can create a custom domain on Cloudflare, point its DNS A record to the victim's IP address, disable certain protection features, and launch attacks through Cloudflare's infrastructure.

  5. Why does allowlisting Cloudflare IP addresses fail to block this attack?

    The allowlist permits traffic from Cloudflare's IP range, including malicious traffic routed through Cloudflare by an attacker. That traffic therefore appears legitimate from the victim's perspective.

  6. How can customers strengthen Authenticated Origin Pulls against this bypass?

    Customers should configure Authenticated Origin Pulls with their own custom SSL/TLS certificates instead of Cloudflare's shared certificate. This provides domain-specific authentication and reduces the risk of impersonation.

  7. How can Cloudflare Aegis help protect an origin server against this bypass?

    Cloudflare Aegis can define a more specific egress IP address range tailored to the customer's needs. If available, it can enhance security by limiting which IP addresses may connect to the origin server.

Written with AI from this article, and checked against it.

Vishal

About the author

· Software & security engineer

GitHub · LinkedIn · X

Vishal writes Trickyworld's tutorials and interview-preparation guides on programming, databases, cyber security and AI. Vishal has been shipping production software long enough to have firm opinions about Python, PHP, Node.js, and JavaScript, and to have been wrong about each of them at least once. The work has run the whole stack: Drupal and Laravel applications, React front ends, MySQL and MongoDB underneath, Redis and Memcached for the things that had to be fast, Apache Solr for the things that had to be findable. That last part turned out to matter more than anyone expected. Tune a Solr index for a season, then watch a language model confidently retrieve the wrong document, and you recognise an old problem wearing new clothes. Most of what is hard about AI systems is not the model. It is retrieval, caching, latency budgets, and deciding what the system does when the answer comes back wrong — which is work he has been doing since well before anyone called it AI engineering. He plays a lot of games, which is less a hobby disclosure than an admission of where a good share of his engineering instinct came from. Real-time systems with a frame budget. State that has to stay coherent while a player does something no designer anticipated. The permanent question of what happens when the frame cannot finish in time. Those habits carry over more directly than they have any right to. He has written several books on programming, all built on the same conviction: most technical writing is unclear because the author never decided what to leave out. More from Vishal → · Editorial policy

#Cloudflare vulnerability#SSL/TLS certificate#bypassing Cloudflare#DDoS Protection#internet security#cybersecurity#cross-tenant security#Cloudflare

More on Computer Tricks.

Latest articles

$ subscribe --weekly

Get the next tutorial in your inbox.

Programming, security and AI — the practical bits, no spam. Unsubscribe any time.