How I Chained 3 Vulnerabilities to Achieve Account Takeover (ATO)
The password reset endpoint reflected an unsanitised email parameter, allowing cross-site scripting. An attacker could use this to steal the CSRF token and then change a victim's password without knowing the current one, locking them out.
medium.com
Published on medium.com
or confidentiality reasons, I cannot disclose the actual name of the program where I found this vulnerability. Therefore, I will use Example.com as a placeholder.
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 email parameter was reflected without sanitisation, and the password change endpoint did not require the current password.
Impact
An attacker could steal a user's CSRF token via XSS and change their password without consent, locking them out of their account.
What the attacker needed
Victim is logged in; victim clicks a link; attacker can host a page
The fix
The report states the vulnerability was patched, but does not describe the fix.
How it was found
- Identify the password reset endpoint with an email parameter.
- Inject a script payload into the email parameter and confirm it executes.
- Use the XSS to fetch the CSRF token from the account page and send it to an attacker-controlled server.
- Craft an HTML form that posts the stolen token and a new password to the account endpoint.
- Host the form and trick a logged-in user into opening it.
- The form auto-submits and changes 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 website put user input directly into a web page without cleaning it, so an attacker could make the page run their own JavaScript. That script could read a secret token meant to protect forms, and then use it to submit a password change on behalf of the victim. The site also allowed password changes without asking for the old password, which made the attack possible.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.