The €400 Bug - VPN/Geo Location Bypass
The application decided a user's location from the X-Forwarded-For header, which the client controls, instead of the real network source address. An attacker could therefore bypass the geo-location restriction and create or use accounts even while connected through a VPN.
infosecwriteups.com
Published on infosecwriteups.com
While hunting on the bug bounty platform REDACTED, I approached the target the way I always do like a hunter.
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
The backend trusted the client-supplied X-Forwarded-For header for geo-location decisions instead of validating the real source IP from the network layer.
Impact
The geo-location restriction could be bypassed entirely, allowing blocked users to create and use accounts from disallowed regions, though the report does not show any further harm beyond that.
What the attacker needed
Ability to intercept and edit requests; a VPN or blocked region
The fix
The application should derive the client IP from the actual network connection and only honour forwarding headers when the request comes from a trusted proxy.
How it was found
- Log in and capture the request in an intercepting proxy.
- Replace the source IP value in the X-Forwarded-For header with a private address followed by a trusted public address.
- Send the request and observe that the geo-location restriction is bypassed.
- Repeat while connected through a VPN to confirm the bypass still works.
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.
Some websites try to guess where you are from your internet address so they can block certain countries. Behind the scenes, a server often reads a header called X-Forwarded-For, which is supposed to be filled in by a trusted middleman. Here the site believed whatever the visitor put in that header, so the visitor could simply claim to be somewhere allowed.
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.