Exploiting Post Reflected XSS via CSRF : Real world bug
A username field on a password-reset page reflected user input without sanitisation, allowing script execution. Because the vulnerable request was a POST, the author chained it with a cross-site request forgery page so a victim visiting an attacker-hosted URL would submit the payload and run the script.
Rahulkrishnan_R_Panicker Follow
Published on medium.com
Reflected XSS or reflected cross site scripting is a bug that allow attacker to run malicious code on user browser
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 echoed the username parameter into the response without output encoding, and the endpoint accepted POST requests without CSRF protection.
Impact
An attacker could run script in a victim's browser to steal cookies, show fake content, or make the browser download malware.
What the attacker needed
Victim visits attacker-hosted page; victim's browser submits the form
How it was found
- Open the forgot-password page.
- Enter a script payload in the username field and submit.
- Observe the script executing and showing the session cookie.
- Note that submitting redirects to a servlet endpoint that also reflects the username but only accepts POST.
- Host an HTML page that auto-submits the payload to that servlet and send its URL to a victim.
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.
Reflected cross-site scripting (XSS) happens when a website takes something you typed and puts it straight back into the page without cleaning it, so a browser treats it as code instead of text. Here the dangerous input was sent in a form submission (a POST request), which a victim cannot be tricked into sending just by clicking a link. The author therefore built a page that automatically submits the form for the victim, a trick called cross-site request forgery (CSRF), so the script runs in the victim's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.