Skip to content
XSS Write-up Intermediate

How I got Account Take Over in a Bug Bounty Program

A note-taking app allowed users to upload SVG files as note background images, and the SVG's embedded script executed when the file was viewed, giving stored cross-site scripting. Because accounts created through Google had no password, the script could call the set-password endpoint on the victim's behalf and set a new password, taking over the account.

medium.com

Published on medium.com

This is my first bug bounty article and I want to share a account takeover (ATO) vulnerabilities through Cross-Site Scripting (XSS) that I discovered over the past half year. Let’s get started!

Hiroki Sawada, 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 app served user-uploaded SVG files inline without sanitising or neutralising embedded scripts, so the SVG's script ran in the app's origin.

Impact

An attacker could take over the accounts of users who viewed a shared note, including accounts that had no password set.

What the attacker needed

Ability to upload SVG backgrounds; victim opens the shared note; victim account created via Google

How it was found

  1. Upload an SVG containing a script as a note background image
  2. Open the SVG link and observe the script executing
  3. Create or use an account made with Google, which has no password
  4. Send a request to the set-password endpoint to confirm it works
  5. Embed a script that calls the set-password endpoint into the SVG and upload it
  6. Share the note so the victim opens it and their password is set

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 note-taking app let people upload picture files in a format called SVG, which can contain code as well as shapes. The app showed those files without stripping the code, so the code ran in the browser of anyone who opened the note. The attacker used that running code to quietly set a new password on the victim's account, which had none before.

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.