⚡ The Reflected XSS Hidden Inside a Login Page — And How a Single Parameter Became a Security Weak…
A login page reflected the value of a request parameter into the HTML response without encoding, so an attacker could craft a link that executed arbitrary JavaScript in a victim's browser. Because the page is unauthenticated, an attacker could use it to steal credentials or alter the login form.
Published on medium.com
Some vulnerabilities feel almost poetic. A login page — a place designed to protect access — accidentally becomes the perfect spot for an attacker to execute arbitrary JavaScript.
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 application reflected user-controlled input from the request parameter into the HTML response without encoding or sanitisation.
Impact
An attacker could run arbitrary JavaScript in a victim's browser on the real login page, potentially stealing usernames, passwords, MFA codes and CSRF tokens, or rewriting the form to send credentials to a phishing server.
What the attacker needed
Victim clicks a crafted link; no authentication needed
How it was found
- Notice that the login page reflects the request parameter into the HTML response.
- Craft a script payload and encode it.
- Place the encoded payload into the request parameter of the URL.
- Load the page and observe the JavaScript executing without authentication.
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.
A login page takes a value from the web address and puts it directly into the page it sends back. If that value contains code, the browser runs it as if the site itself had written it. An attacker can send a link that makes the victim's browser run the attacker's code on the real login page.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.