Skip to content
Account takeover Write-up Intermediate

Twitter Email Verification Bug let Hackers Impersonate Identities and Access Accounts on 3rd Party Services!

A flaw in Twitter's signup flow caused the email verification code to be sent to the email address of the currently logged-in user rather than the email address being signed up, allowing an attacker to verify an email they do not control. This could let an attacker impersonate a non-Twitter user on third-party sites that use 'Login with Twitter' and trust the verified email address.

seekurity.com

Published on seekurity.com

Today I’m gonna show you how to verify any (unused) email on twitter account without having access to the email itself

The author, on seekurity.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 application took the email address from the logged-in session (cookie, local storage, or server-side session) instead of from the signup form input when sending the verification code.

Impact

An attacker could verify an email address they do not own and potentially impersonate a non-Twitter user on third-party websites that use 'Login with Twitter' and trust the email address, though the impact depends on how those sites handle login.

What the attacker needed

Attacker has a Twitter account; attacker knows victim's email address; victim has no Twitter account; third-party site uses Login with Twitter and trusts email

The fix

The verification code should be sent to the email address entered during signup, not to the email address associated with the current session.

How it was found

  1. Log in to Twitter and visit the signup page; an error appears.
  2. Log out and visit the signup page; the error disappears.
  3. Intercept the server request with a proxy, log in again, visit the signup page, and replay the intercepted request so the error disappears.
  4. Continue the signup process and reach the email verification step.
  5. Observe that the verification code is sent to the logged-in account's email rather than the signup email, and use it to verify the other email 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 sign up for a website, it usually sends a code to the email address you typed to prove it is yours. Here, if you were already logged in to another account, the code went to that account's email instead, so someone could prove they owned an email address they did not actually control. That could let them pretend to be someone else on other websites that use Twitter to log people in.

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.