Web security · Bug bounty walkthrough

How I Bypassed an IP Whitelist With One Header

Nazeer Ahmed By Nazeer Ahmed · Redacted bug bounty write-up
Illustration depicting an X-Forwarded-For (XFF) header bypass technique in web security
Bypassing IP-based restrictions using the X-Forwarded-For header.

Not every bypass needs a clever payload. Sometimes it just needs a header the server already trusts.

This is a walkthrough of a bug I found, reported, and got paid for — already fixed and closed out. I’ve stripped the company name, the real IPs, the internal hostname, and anything else that could point back to the target. What’s left is the method, because the method is what travels to your next target.

The setup

The target had an internal tool sitting behind what looked like a hard perimeter — the kind of thing a company assumes is invisible from the outside: a build server, an internal dashboard, a code-quality scanner, something along those lines. Hit it directly and you got a clean 403 Forbidden. The team believed this was unreachable from the public internet.

It wasn’t unreachable. It was gated by an IP allow-list enforced at the edge — a reverse proxy or WAF deciding who counts as “internal.” And an allow-list built on the wrong signal is one of the easiest “secure” things there is to walk straight through.

The idea behind it

When a request passes through a proxy or load balancer, the backend often can’t see the real client IP anymore — it only sees the proxy’s IP. So proxies forward the original IP in a header, usually X-Forwarded-For (sometimes X-Real-IP, X-Client-IP, or True-Client-IP).

Here’s the catch: that header is just text in the request. If the edge device trusts whatever value shows up in it, instead of checking the actual TCP connection, then anyone can write their own “internal” IP into the header and ask to be let in.

A whitelist that trusts a client-supplied header isn’t a whitelist. It’s an honor system.

What I actually did

The exact endpoints don’t matter here. What matters is the pattern: perimeter trust was based on a header, not on anything cryptographic or connection-level, and the backend never questioned it again once that header said “internal.”

Why it mattered more than it first looked

This wasn’t just “I can see some JSON.” Once you’re treated as internal:

The triage conversation on this one was its own lesson. My initial severity estimate was higher than where it landed — the proof I had showed access, not data exfiltration or irreversible damage, and the program scored it accordingly. Both things can be true at once: a bug can be real, accepted, and paid, and still land at a more conservative CVSS than you first expected. Don’t let that discourage you from writing it up properly.

How to go find this yourself

One habit worth stealing

Every allow-list, every “internal only” claim, every access-control check — ask what it’s actually checking. A real identity? A signed token? Something about the connection itself? Or just a value the client is free to type in?

If it’s the last one, it’s not a control. It’s a suggestion.

Do you test trust headers by default, or only after a 403 makes you curious?

Get a free bug check for your site or app: trendcatcher.pro

#BugBounty #AppSec #AccessControl #InfoSec #TrendCatcher