Day 4: Escalating Self-Stored XSS to Account Takeover via IDOR
A profile name field accepted an XSS payload that executed as self-XSS, and the profile update request also accepted an arbitrary email address, allowing the attacker to apply the payload to another user's account. This let the attacker run JavaScript in the victim's session, potentially stealing cookies and taking over the account.
medium.com
Published on medium.com
For Day 4 of my 100-day ATO challenge, I read an interesting write-up by Jefferson Gonzales, where he escalated a Self-Stored XSS vulnerability into full Account Takeover (ATO) by chaining it with an IDOR (Insecure Direct Object Reference) bug.
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 profile update endpoint identified the target account by a user-supplied email address instead of the authenticated session, and the name field was rendered without sanitisation.
Impact
An attacker could execute JavaScript in any user's session, potentially stealing session cookies and modifying profiles or escalating privileges.
What the attacker needed
A free account on the target subdomain; knowledge of the victim's email address; victim visits their own profile page
The fix
The issue was reported and later patched by HackerEarth.
How it was found
- Sign up on the subdomain and change the name to an XSS payload.
- Observe that the payload executes but only on your own profile.
- Inspect the profile update request and notice the email parameter.
- Create a second account and replace the email with the victim's email.
- Submit the request and observe the XSS executing on the victim's account.
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 self-XSS is a script that only runs in your own browser, so on its own it is not dangerous to others. Here the profile update request also trusted an email address supplied by the user, so the attacker could point the same malicious name at someone else's account. That turned a harmless self-XSS into a stored XSS that ran for the victim.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.