Reflected XSS via X-Forwarded-For Header on https://api.target.com/ip
An endpoint that echoes back the client IP address reflected the value of the X-Forwarded-For header without sanitising it. An attacker could craft a request with a script payload in that header and have it execute in the response, giving reflected cross-site scripting.
Published on medium.com
Hi, Today I will discuss about how I found this bug in a target. A clean and simple one.
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
Impact
An attacker could execute script in a victim's browser through a crafted request, though the report gives no details on what that script could achieve.
What the attacker needed
Victim sends a crafted request; attacker controls the X-Forwarded-For value
How it was found
- Find the /ip endpoint that returns the caller's IP address
- Capture the request and send it to Burp Intruder
- Run an active scan on the request
- Set the X-Forwarded-For header value as the insertion point and scan it
- Observe the reflected XSS result
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 show you information you send them, such as the address your request appears to come from. Here the site copied a header value straight into the page without cleaning it, so text that looks like code can run in a visitor's browser. That is called cross-site scripting, and it lets an attacker run their own code in someone else's session.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.