Skip to content
XSS Write-up Intermediate

Stored DOM XSS to Account Takeover

A post creation feature stored user-supplied HTML that was re-rendered by a translation view, allowing script execution in the browser of anyone who viewed the translation. The attacker used this to read a victim's stored authentication token and then replay it against the API to access the victim's account data.

medium.com

Published on medium.com

Assalamualaikum bug hunter, di write up ini saya tulis bagaimana saya melewati filter dengan payload yang whitelist untuk memaksimalkan fitur dan menaikan dampaknya ke account takeover

0xRedFox29, 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 translation view re-rendered stored post content without properly sanitising event-handler attributes, so a whitelisted tag with an inline handler executed.

Impact

An attacker could steal a victim's authentication token and use it to read the victim's account details through the API, resulting in account takeover.

What the attacker needed

Two accounts; victim clicks view translation; attacker-controlled external server

How it was found

  1. Create two accounts and use separate browsers, one with an intercepting proxy.
  2. Log in and create a new post with a title and content containing the crafted markup.
  3. Set the post to public, choose a category and publish it.
  4. Share the post link with the second account, which is logged in.
  5. Have the second account click the view translation option, which triggers the external request.
  6. Read the captured token from the external service and replay it against the API users/me endpoint to retrieve the victim's data.

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 website let people write posts that could contain hidden instructions for the browser. When another user clicked a 'view translation' button, those instructions ran in that user's browser and quietly sent their login token to the attacker. With that token, the attacker could act as the victim on the site's API.

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.