Skip to content
XSS Write-up Advanced

How I Managed to Achieve Full Account Takeover on a 50Million+ Us

The recommendation feature lacked server-side validation of profile ownership, allowing an attacker to post recommendations to any profile. A client-side sanitizer and a regex check could be bypassed with malformed HTML, leading to stored XSS that enabled account takeover by changing the victim's email without password confirmation.

Pakka0 Follow

Published on medium.com

There was no server-side validation confirming that the invitation truly belonged to that profile owner.

Pakka0, on medium.com

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 combination of missing server-side ownership validation on the recommendation endpoint, client-side-only sanitisation using a blacklist, and a regex that failed to detect malformed HTML tags.

Impact

An attacker could achieve full account takeover of any user by changing their email address and resetting the password, with no victim interaction required.

What the attacker needed

Two attacker-controlled accounts; ability to intercept requests; victim views the profile

How it was found

  1. Send an invitation from attacker account A to attacker account B.
  2. Intercept the request and replace the profile_owner_id with the victim's profile ID.
  3. Submit a recommendation containing malformed HTML that bypasses the client-side sanitizer and regex check.
  4. The stored XSS executes when the victim views the profile, extracting the XSRF token and user_id from cookies.
  5. Use the extracted token to send a PATCH request changing the victim's email to an attacker-controlled address.
  6. Trigger a password reset to the new email and complete account takeover.

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 write recommendations on profiles, but it didn't check that the person writing really owned the profile. It also tried to clean up dangerous HTML on the user's computer instead of on the server, and a simple pattern check could be fooled by leaving off a closing bracket. This let an attacker run their own code in a victim's browser and change the victim's email address, taking over the account.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.