Skip to content
Access control Write-up Intermediate

RIP Cloudflare: Bypass IP Whitelisting Restrictions

The article describes how an origin server protected by Cloudflare IP whitelisting can be reached by sending requests through Cloudflare's own infrastructure, either via a Cloudflare Worker acting as a reverse proxy or by adding a proxied DNS record pointing to the origin IP. This allows an attacker who has discovered the origin IP to bypass the whitelist and access the server directly.

medium.com

Published on medium.com

Welcome to the “RIP Cloudflare” series, where we poke holes in Cloudflare’s shiny armor and dig up the origin IPs it’s hiding like buried treasure. Businesses and devs love to slap Cloudflare on their sites like it’s a “Keep Out” sign, forgetting that their backend might still be held together with duct tape.

0vulns 🇸🇩, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the origin server trusts any request coming from Cloudflare's IP ranges without further authentication, so an attacker can use Cloudflare's own services to relay requests to the origin.

Impact

An attacker who knows the origin IP could bypass IP whitelisting and access the origin server directly, potentially exposing it to further attacks.

What the attacker needed

Knowledge of origin IP; Cloudflare account

The fix

The origin server should not rely solely on IP whitelisting; it should also require authentication or use Cloudflare Tunnel with authenticated connections.

How it was found

  1. Discover the origin IP address of the target.
  2. Create a Cloudflare Worker that forwards requests to the origin IP.
  3. Execute the Worker to send requests through Cloudflare's network.
  4. Alternatively, add a new A record in Cloudflare dashboard pointing to the origin IP.
  5. Enable the Proxy option for the new DNS record.
  6. Access the origin server through the new domain.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A website owner might hide their real server behind Cloudflare and only allow connections from Cloudflare's computers. If someone finds the real server's address, they still cannot connect because the server rejects everyone else. This article shows two ways to make requests appear to come from Cloudflare, so the server lets them through.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.