Dev.to Security 🔐 Cybersecurity 👁 0 📖 10 min read

How Origin IP Exposure Bypasses Your CDN and WAF

How Origin IP Exposure Bypasses Your CDN and WAF Disclosure: I work at SkyCloud Computing (騰雲運算). This is an English adaptation of our guide on origin IP exposure, originally written for a Taiwan audience. I have kept

How Origin IP Exposure Bypasses Your CDN and WAF

Disclosure: I work at SkyCloud Computing (騰雲運算). This is an English adaptation of our guide on origin IP exposure, originally written for a Taiwan audience. I have kept the same facts and tried to be even-handed; please verify current product details with each vendor.

Many teams treat a CDN or cloud WAF as a complete shield. That only holds if traffic actually goes through it. The moment an attacker learns the origin server's real IP address, they can send DDoS and exploit traffic straight to the host, skipping the edge entirely. Origin bandwidth and compute are almost always much smaller than the CDN's, so a bypass can take the site down even while the CDN dashboards still look quiet. Hiding the origin IP is a prerequisite for the rest of the edge stack to work. This article covers why origin IPs leak, how to check, and how to lock the origin down — with an APAC lens on in-region scrubbing, support language and timezone, and attack-time billing.

What an origin IP is, and why it has to stay hidden

In a CDN architecture the path is user → CDN node → origin. The origin holds the real content and does the work: logins, checkout, live queries, and anything else that is not in cache. The origin IP is that server's address. After you onboard a CDN or cloud WAF, DNS for the public hostname usually points at the provider's edge. Everyday users hit the edge first; the edge filters and accelerates traffic, then forwards legitimate requests onward. That shield only covers traffic that follows DNS. If someone knows the origin IP, they can go around it.

What goes wrong when the origin IP leaks

1. DDoS hits the origin, and CDN scrubbing never sees it. Floods aimed at the origin IP never reach a scrubbing center. They land on the origin's own uplink. At many mid-size companies that link is only hundreds of Mbps to a few Gbps, which is enough for a mid-sized attack to saturate.

2. The WAF is skipped. WAF rules only apply to traffic that passes through the WAF. A direct connection can send SQL injection, cross-site scripting, and other application attacks straight at the app.

3. The bypass is easy to miss. The attack never touched the CDN or WAF, so those systems may log nothing unusual. Reports can look fine until the origin itself fails.

4. The host becomes a scan target. Once the IP is public, attackers can probe open ports and services — remote administration, databases, staging environments — and look for a second way in.

5. The site goes down for everyone. If the origin is overwhelmed, even visitors who still go through a healthy CDN cannot get a response. Orders, support, and trust all take the hit.

Six common ways an origin IP leaks

Attackers usually do not need to break into anything. They look up information that is already public. A 2015 study behind the CloudPiercer tool found that 71.5% of 17,877 sites protected by cloud-based security providers exposed their real origin IP through at least one vector. Wordfence later cited that work as "about 70%." Those numbers are a decade old, so they should not be read as a current industry rate. The leak paths the study measured, though, are still the ones teams run into.

1. Historical DNS records. Before the CDN was added, DNS pointed at the origin. Archives of historical resolutions keep that old address around. If you never changed the origin IP after cutting over, the old record still works. Change the origin IP when you adopt a CDN, and keep the new address out of any public DNS record.

2. SSL certificates picked up by internet-wide scans. Platforms such as Shodan and Censys scan the public internet continuously. If the origin answers a direct IP connection with a certificate that names your domain, the scanner will associate that IP with the domain. Certificate Transparency logs are also public; a certificate issued for an internal hostname can give away a backend. Reject raw-IP requests, and allow only your CDN's egress addresses (or an equivalent authenticated pull) to reach the origin.

3. Subdomains that do not go through the CDN. The apex or www hostname may be proxied, while mail, ftp, dev, or test still point at the same host or the same subnet. Put every public subdomain behind the CDN. Keep staging and admin interfaces off the public internet, or restrict who can reach them.

4. Mail servers and SPF records. If the web origin also sends mail, message headers will carry its IP. The domain's SPF record may list the origin, or a neighboring address, in the clear. Send mail from a separate service or host, and confirm the origin IP is not in SPF.

5. Hard-coded IPs, and features that connect outbound. Source, JavaScript, or an API response sometimes contains a raw IP or internal URL. Features that make the server connect out — URL preview fetchers, or WordPress XML-RPC pingbacks — can also leave the origin IP in someone else's logs. Remove hard-coded addresses, turn off unused outbound features such as XML-RPC, and move any function that must dial out onto a different host.

6. Leftover hosts after a migration. Old staging boxes, pre-move servers, or decommissioned environments that are still online often sit outside the CDN but still serve the same content or the same certificate. Inventory hosts regularly, and take unused environments offline once a move is finished.

Four checks you can run yourself

The same public sources are available to you, so your team can look for exposure before an attacker does. Run these on a schedule.

1. Look up historical DNS. Use a service that archives past resolutions for your domain. If the pre-CDN address is still your current origin IP, that address is already public.

2. Search for your certificates. In Censys or Shodan, search for your domain and look closely at any non-CDN IP. Use crt.sh to list every hostname that has ever had a certificate issued.

3. Inventory every subdomain and mail record. Confirm whether each name resolves to a CDN node or to a host you run. Check MX and SPF for the origin, or an address in the same subnet.

4. Connect to the origin IP directly. From a network that is not the origin, try the IP itself. If you can load the site or see your certificate, the origin is accepting direct access. A simple check against an address you already know is yours:

curl -sI --resolve example.com:443:ORIGIN_IP https://example.com/
# or
curl -sI https://ORIGIN_IP/ -H "Host: example.com" --insecure

Replace the placeholders with your own hostname and origin IP. If this returns your application or your certificate, fix the allow list before you do anything else.

If the origin IP is already exposed: five steps

Changing the IP is the right end state, but it is not always instant: you have to update the CDN origin, and sometimes move the host. If you change the address without closing the leak, the new IP can show up in the same place a few days later. An allow list alone is also incomplete: it stops most direct connections, but a large flood can still fill the uplink even when the firewall is dropping packets. Stop the bleeding first, then remove the source of the leak.

1. Map the exposure. Run the four checks above. Note every path and every IP that is public, so later steps do not leave one behind.

2. Allow-list the CDN immediately. Get the current egress IP list from your CDN provider and permit only those sources at the origin firewall. Configure the web server to refuse requests that are not for your hostname, so a raw-IP hit does not serve the site. Test afterwards that ordinary users can still reach the site through the CDN.

An IP allow list is the baseline. Where your provider supports it, add origin authentication as well: Cloudflare Authenticated Origin Pulls (mTLS), or, on AWS, a security group that only allows the CloudFront managed prefix list. Shared anycast ranges prove traffic came from that network, not necessarily from your account; use dedicated egress IPs or a customer-specific client certificate if you need that stronger guarantee.

3. Change the origin IP. Old addresses remain in historical DNS and scanner databases; you cannot delete them. Request a new IP from your data center or cloud provider, update the CDN origin, and use the new address only there — not in public DNS, not for mail, and not for other services. After the cutover, retire or release the old IP so it is no longer a target.

4. Close each leak path. Recheck the mitigations above: public subdomains behind the CDN, mail separated from the origin, SPF cleaned up, hard-coded IPs removed, and old hosts offline.

5. Keep watching. If origin traffic or firewall logs show a burst of non-CDN sources, or origin load spikes while CDN reports stay flat, the IP may be exposed again. Recheck at least once a quarter, and immediately after you add a subdomain, move a host, or change providers.

Leak path What to do
Historical DNS records Change the origin IP when you adopt a CDN
Certificates found by internet-wide scans Block raw-IP access; allow only the CDN (and authenticate origin pulls where you can)
Subdomains not behind the CDN Put public subdomains on the CDN; keep internal environments off the public internet
Mail servers and SPF Run mail on a separate service; audit SPF
Source or outbound features that reveal the IP Remove hard-coded IPs; disable or isolate outbound features
Leftover hosts after a migration Inventory regularly and take old environments offline

Four things to ask a CDN provider

Most of the steps above are under your control. Whether the origin stays hidden during an attack, and whether the uplink survives, also depends on the provider. If you are choosing or changing a CDN, ask these four questions — especially if your users and origins are in APAC.

1. Can attack traffic be dropped before it reaches the origin? Ask where the scrubbing centers are, how much capacity they have, and what attack sizes the provider has actually handled. For APAC audiences, proximity matters: a center near the attack source, and near your users in places such as Singapore, Tokyo, Taipei, Hong Kong, or Sydney, reduces how much junk ever sits on regional links.

2. Will someone help you with the cutover? Changing an origin IP, building an allow list, and updating origin settings all require coordination. A single mistake can take the site down or leak the new IP. During an attack, reaching an engineer in your language and timezone is often the difference between minutes and hours of downtime. Confirm whether support is 24×7, whether it costs extra, and which languages are actually staffed.

3. Do you get billed for attack traffic? If mitigated attack volume is charged like normal traffic, an incident becomes a billing event as well as an outage. Some providers sell a basic plan and only offer a serious upgrade once you are already under fire. Before you sign, ask whether attack traffic is billed, and what happens when you exceed a protection cap.

4. Can the provider stop both floods and slow Layer 7 attacks? A short, huge flood and a low-and-slow application-layer attack that hides in legitimate traffic are different problems. Slow attacks often look like real users if you only watch volume, so the provider needs behavioral analysis as well as raw capacity.

One regional example, since this guide started as a Taiwan article: SkyCloud is a Taiwan-developed CDN and security vendor. In the original guide it describes scrubbing centers in the United States, Japan, Taiwan, Singapore, and Hong Kong; 24×7 support, including help with onboarding and during an attack, from an engineering team in Taiwan that can work in Chinese; and behavioral analysis aimed at both volumetric floods and slow Layer 7 attacks. It also holds ISO 27001 and ISO 27701 certifications, and is listed on Taiwan's Government Common Supply Contract (共同供應契約). Treat that as one option to evaluate, not as a default.

Quick answers

Does a CDN guarantee that the origin IP stays hidden? No. The CDN only hides the path that follows DNS. Historical DNS, certificate scans, subdomains that skip the edge, and mail headers can still leak the address. After you adopt a CDN, still change the origin IP and restrict the host so only the CDN can connect.

The origin IP is already public. Now what? Change it, and allow-list only CDN nodes on the new address. Then confirm the new IP is not leaking again through a subdomain, mail, or a certificate.

How can you tell that an attack is hitting the origin directly? If CDN reports look normal but origin bandwidth or host load is rising, a bypass is likely. Check origin firewall logs for sources that are not CDN nodes.

Is a firewall allow list enough? It stops most direct connections, but a large flood can still fill the uplink even when packets are rejected. Pair the allow list with a new origin IP.

How often should you check? At least once a quarter, and immediately after you add a subdomain, move a host, or change providers.

Learn more about SkyCloud Computing at skycloud.com.tw.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.