From 429 to 200: From Bypass to Bounty using X-Overwriting Header
The application implemented IP-based rate limiting on the login endpoint, but it trusted the X-Forwarded-For header to determine the client IP. An attacker could spoof this header to bypass the rate limit and perform unlimited brute-force attempts.
Published on infosecwriteups.com
We have all come across something like this before, especially when we forget the password to our account. Most applications are forgiving, so they would usually ask you to cool down and try again later after repeated invalid logins.
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 application trusted the X-Forwarded-For header without validating that it came from a trusted proxy, allowing clients to spoof their IP address.
Impact
An attacker could bypass the rate limit and perform unlimited brute-force attacks against user accounts.
What the attacker needed
Access to the login endpoint; ability to set custom HTTP headers
The fix
The application should be configured to only trust X-Forwarded-For headers from known proxies or use the network-level IP address instead.
How it was found
- Send a login request with an X-Forwarded-For header set to a localhost IP.
- Observe that the rate limit is bypassed and the spoofed IP appears in the response.
- Use Burp Intruder with a payload position in the IP address octet and a Numbers payload type to iterate through many IPs.
- Run the attack to send each request with a different spoofed IP, achieving brute force.
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.
Rate limiting is a security control that blocks too many requests from the same source, like limiting login attempts. Here, the app used the IP address from a header that the client can set, so an attacker could pretend to be a different IP each time and avoid the block.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.