Full Account Takeover via XSS: My Bug Hunting Win… or Was It?
A stored cross-site scripting flaw in the user name field of a settings page allowed an attacker to inject a script that ran when an administrator viewed the user list. The script stole the administrator's session cookies, enabling the attacker to log into the admin panel without credentials or the two-factor code.
medium.com
Published on medium.com
Hi, I’m Syed Mushir, 17. This is my first post.
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 validate, filter, or sanitise user-supplied input in the name field, and session cookies lacked the HttpOnly flag, allowing script access.
Impact
The attacker could take over the administrator account and access the admin panel without credentials or the two-factor code.
What the attacker needed
A free user account; admin views user list; attacker-controlled server
The fix
The bug was fixed by the website owners after two days of maintenance.
How it was found
- Create a user account on the website.
- Find the admin subdomain and observe the login page has a two-factor code field.
- In the user panel's Settings page, enter a name containing an XSS payload and see it is not filtered.
- Replace the name with a script that steals cookies, URL, and a screenshot, hosted on an external server.
- Wait for an administrator to view the registered users page, which triggers the script and sends data to the attacker.
- Use the stolen cookies in a browser extension to access the admin panel.
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 let users type their name without cleaning it up, so someone could put a small program (a script) in their name. When an administrator looked at the list of users, that program ran in the administrator's browser and sent the administrator's login cookie to the attacker. The attacker then used that cookie to pretend to be the administrator and access the admin panel.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.