Bypassing Rate Limit Protection by spoofing originating IP
A web application blocked the tester's IP address after repeated fuzzing attempts, but the rate limit could be bypassed by sending the X-Forwarded-For header twice instead of once. An attacker could therefore continue sending requests past the intended rate limit by spoofing a different originating IP.
Published on medium.com
#### Arbaz Hussain
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 a client-supplied X-Forwarded-For header for rate limiting, and its handling of duplicate headers let the spoofed value take effect.
Impact
An attacker could bypass the rate limit and keep sending requests, which may enable brute force or fuzzing that the protection was meant to stop.
What the attacker needed
Target uses X-Forwarded-For for rate limiting
The fix
The application should not trust client-supplied forwarding headers for rate limiting, or should normalise duplicate headers and use the real connection address.
How it was found
- Send enough fuzzing requests to get the tester's IP blocked.
- Try a Host header injection to bypass the block, which failed.
- Try a single X-Forwarded-For header to spoof the IP, which failed.
- Send the X-Forwarded-For header twice instead of once, which bypassed the rate limit.
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.
Many websites use a header called X-Forwarded-For to learn the visitor's IP address, because traffic often passes through proxies. The site trusted this header when deciding whether to block someone, so the tester could pretend to come from a different address. Sending the header twice confused the rate-limit logic and let requests through.
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.