Skip to content
Account takeover Write-up Advanced

The AccountTakeOver Killing Chain

The application had a self-XSS in the email change feature, a CSRF token that never changed per device, and a passwordless login flow. By combining these, an attacker could force a victim to log into the attacker's account, trigger the XSS, steal the victim's CSRF token, and later use it to change the victim's email and take over their account.

أنس روبي Follow

Published on web.archive.org

{{media:0}}

أنس روبي, on web.archive.org

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 a self-XSS in the email field, a CSRF token that remained static per device, and a passwordless login flow that allowed session fixation.

Impact

An attacker could change a victim's email address and take over their account, despite HTTP-Only and Secure cookies.

What the attacker needed

Victim clicks a link; attacker has an account; victim logs back into their account

How it was found

  1. The attacker sets their own email to a payload containing a script.
  2. The attacker creates two login sessions and opens one to obtain its session ID.
  3. The attacker sends the victim a link that logs the victim into the attacker's account using the second session.
  4. Once the victim is logged in, the attacker triggers a change of email on the attacker's session, which causes the XSS to execute in the victim's browser.
  5. The XSS steals the victim's CSRF token and sends it to the attacker's server.
  6. Later, when the victim logs back into their own account, the attacker uses the stolen CSRF token to change the victim's email and take over the 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.

This report describes how three small weaknesses were chained together. A self-XSS only runs in your own browser, but the attacker tricked the victim into logging into the attacker's account so the script ran for the victim. Then, because the site's security token never changed, the attacker could reuse it later to change the victim's email and take over the account.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by أنس روبي

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.