Account Takeover via XSS + CSRF and Browser Autofill Password
A stored cross-site scripting flaw in the Full Name field let an attacker inject HTML that caused the browser's autofill to populate a fake password field with the victim's saved credentials. The stolen password was then replayed in a cross-site request forgery to change the victim's account password without any interaction.
Published on medium.com
Our goal is to change the victim’s email or password. However, as you can see, the request requires the current password, so even if we find a CSRF, we won’t be able to complete the request.
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 failed to encode user-controlled output in the Full Name field, allowing stored HTML and script injection, and the password change endpoint lacked CSRF protection beyond the session cookie.
Impact
An attacker could take over a victim's account by stealing their saved password and changing it, with no victim interaction, though the attack depends on the victim having saved credentials for autofill.
What the attacker needed
Victim has saved credentials for autofill; attacker can inject stored XSS in Full Name; victim views a page showing the injected name
How it was found
- Inject a stored XSS payload into the Full Name field.
- Use the XSS to fetch the victim's profile information from the same origin.
- Inject an email input and a password input to trigger browser autofill.
- Exfiltrate the autofilled email and password to an attacker-controlled server.
- Use the stolen password as current_password in a CSRF request to change the victim's password.
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.
The site let users put HTML code into their profile name, and that code ran in other people's browsers. The attacker used this to create a fake password box, which the browser automatically filled with the victim's saved password. The attacker then used that password to change the victim's account password.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.