Skip to content
Account takeover Write-up Beginner

Full Account Takeover via Email Confirmation Misconfiguration

The application did not invalidate old email verification tokens when a new email change was requested, leaving multiple tokens active. An attacker with access to a previously used email address could reuse an old verification link to reassign the account email and take over the account.

medium.com

Published on medium.com

During security testing, I discovered a critical Account Takeover vulnerability caused by improper handling of email verification tokens. The application failed to invalidate old email verification links after a new email address was set and verified.

Abhay go, 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

The application does not invalidate previously generated email verification tokens when a new email change request is made, so multiple tokens remain valid at the same time.

Impact

An attacker with access to a previously used email address could reuse an old verification link to reassign the account email and achieve full account takeover, leading to unauthorised access, data exposure, and privilege abuse.

What the attacker needed

Attacker has access to a previously used email address; victim has changed email at least twice

The fix

The application should invalidate all previous email verification tokens when a new email change request is initiated, make tokens single-use, bind them to the most recent request, and enforce short expiration.

How it was found

  1. Register a new account with any email address.
  2. Go to Account Settings, Change Email, and enter a new email address; a verification link is sent but not clicked.
  3. Change the email again to a third address; a new verification link is sent.
  4. Click the verification link sent to the third address to confirm the latest email.
  5. Open the original verification link sent to the second address; the system accepts it and reassigns the account email back to that address.

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.

When you change your email address, the app sends a link to confirm the new address. This report found that the app kept old confirmation links working even after you confirmed a newer email. So if someone else could access an old email address you used, they could click the old link and change your account's email back to theirs, locking you out.

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.

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.