Yes, Cloudflare users have been able to attack another customer’s origin server in specific, documented scenarios, primarily by exploiting misconfigurations or by using Cloudflare’s own features (like Workers or Spectrum) in unintended ways. Researchers have shown that the “security through obscurity” of hiding an origin IP behind Cloudflare is not absolute, and certain Cloudflare features, if not carefully configured, can expose the origin or be abused to launch attacks. This article explains what researchers found, how such attacks work, and what you can do to protect your origin.
Background: How Cloudflare Normally Protects Origins
Cloudflare sits between a website’s visitors and its origin server (the server that actually hosts the content). When configured correctly, all traffic goes to Cloudflare’s IP addresses, and the origin’s real IP is hidden. This provides DDoS protection, caching, and a firewall. The origin server is only supposed to accept traffic from Cloudflare’s IP ranges, which are publicly listed. This is the core of Cloudflare’s security model: the origin is invisible to the public, and even if someone discovers it, the origin should reject any connection that doesn’t come from Cloudflare.
What Researchers Found: The Attack Vectors
Research and real-world incidents have demonstrated several ways this protection can be bypassed or turned against a customer. The most notable findings include:
- Origin IP disclosure via DNS history: Services like SecurityTrails or ViewDNS.info keep historical DNS records. If a domain previously resolved directly to an origin IP before Cloudflare was enabled, that IP is still discoverable. Attackers scan for these old records.
- SSL certificate transparency logs: When you get an SSL certificate for your origin (even a self-signed one), the certificate is logged publicly. Attackers can search these logs for certificates that contain the origin’s IP address or hostname.
- Subdomain enumeration: If you have a subdomain that is not proxied through Cloudflare (a “grey cloud” DNS record), it can reveal the origin IP. Attackers brute-force common subdomains like
dev.,staging., ormail.to find these. - Cloudflare Workers abuse: A malicious Cloudflare user can create a Worker that makes requests to a target origin if they know its IP, and because the request comes from Cloudflare’s IP range, the origin may accept it. This effectively turns Cloudflare’s network into a proxy for attacks, hiding the attacker’s identity.
- Spectrum and other features: Cloudflare Spectrum allows proxying non-HTTP traffic. If an attacker uses Spectrum to connect to a target origin on a non-standard port, and the origin only checks the source IP (not the port), it may allow the connection.
How the Attack Works in Practice
Let’s walk through a realistic scenario. An attacker wants to take down a website protected by Cloudflare. They first discover the origin IP using one of the methods above (e.g., historical DNS). Then they launch a direct DDoS attack at that IP. The origin server is overwhelmed because it’s not protected by Cloudflare’s filtering. Even if the origin has a firewall rule that only allows Cloudflare IPs, the attacker can spoof the source IP to be a Cloudflare IP, or they can use a Cloudflare Worker to send requests that appear to come from Cloudflare. The origin sees a valid Cloudflare IP and responds, exhausting its resources.
Common Misconceptions and Mistakes
Many website owners believe that simply enabling Cloudflare makes their origin invulnerable. That’s false. Common mistakes include:
- Not restricting origin access to Cloudflare IPs: If your origin accepts connections from any IP, attackers can bypass Cloudflare entirely.
- Using the origin IP in DNS records for non-web services: Email (MX records) often points directly to the origin, revealing it.
- Forgetting about old subdomains: A subdomain that was once proxied but is now direct can leak the IP.
- Not using authenticated origin pulls: This feature ensures that only Cloudflare can connect to your origin, but many don’t enable it.
How to Protect Your Origin
To mitigate these attacks, follow these best practices:
- Always proxy your DNS records (orange cloud) for web traffic.
- Use a firewall rule on your origin to only allow connections from Cloudflare’s IP ranges (you can get these from Cloudflare’s API or docs).
- Enable Authenticated Origin Pulls so your origin only accepts mTLS connections from Cloudflare.
- Use a separate IP for non-web services like email, and don’t use the same IP for web and mail.
- Regularly check for exposed IPs using tools like SecurityTrails or by searching your domain on certificate transparency logs.
- Use a VPN or IP allowlist to restrict access to your origin’s admin panels.
Comparison: Cloudflare vs. Other CDNs
This issue is not unique to Cloudflare. Any CDN that hides your origin behind a proxy has the same fundamental vulnerability: if the origin IP is discovered, the protection is weakened. However, Cloudflare’s popularity makes it a bigger target. Other CDNs like Akamai or Fastly have similar features (like origin protection), but their documentation and community support may differ. The key is to understand that the CDN is not a silver bullet; you must configure your origin correctly.
Safety and Limitations
It’s important to note that these attacks are not trivial. They require the attacker to first discover the origin IP, which is not always easy. Cloudflare has also added features to make this harder, such as the “Cloudflare for SaaS” custom hostnames that hide the origin even more. However, no system is 100% secure. The most significant limitation is that if your origin IP is leaked, you must change it and ensure all DNS records are proxied. Also, if you are using Cloudflare’s free plan, you have fewer options (like no Spectrum or Workers), but the basic protection still applies.
Frequently Asked Questions
Can a Cloudflare user directly attack another customer’s origin through Cloudflare?
Yes, if the attacker knows the origin IP, they can use Cloudflare’s network (e.g., via Workers) to send requests to that IP. The origin may accept these requests because they come from Cloudflare IPs, making it appear legitimate. This is why it’s crucial to restrict origin access to only Cloudflare IPs and use authenticated pulls.
How do attackers find the origin IP behind Cloudflare?
Common methods include checking historical DNS records, searching SSL certificate transparency logs, finding unproxied subdomains, and using social engineering or phishing to trick someone into revealing the IP. There are also automated tools that scan for these leaks.
Is it safe to use Cloudflare for my website?
Yes, Cloudflare is safe and provides excellent protection. The vulnerabilities described are not flaws in Cloudflare’s core service but rather in how customers configure their origins. If you follow best practices (proxying all records, restricting origin access, enabling authenticated pulls), the risk is very low.
What should I do if my origin IP is leaked?
Immediately change your origin IP address (if possible), update all DNS records to be proxied, and add a firewall rule to only allow Cloudflare IPs. Also, consider using a different IP for non-web services. After that, monitor your logs for any unauthorized access.
Does Cloudflare protect against all DDoS attacks?
No. Cloudflare can absorb most DDoS attacks, but if your origin IP is exposed, attackers can bypass Cloudflare and target your origin directly. That’s why origin protection is essential. Cloudflare also has rate limiting and WAF rules to mitigate application-layer attacks.
Can I use Cloudflare’s Workers to attack someone?
Technically, yes, but it’s against Cloudflare’s Terms of Service and can result in account termination. Cloudflare monitors for abuse, but it’s not foolproof. As a website owner, you should not rely on Cloudflare to police malicious actors; you must protect your origin.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Reliable Subaru vs New Honda Civic Cost
- Pokemon Bookmark Corner Designs & Pokemon GO DIY
- Forgotten Games That Created Your Favorite Genres
- Lexus vs Genesis Luxurious Compact SUV0.075 hp/lb
- Uber VW Robotaxi LA Launch Date
- Notebook vs Tablet: Which Saves You More Money?