Skip to content
Account takeover Write-up Intermediate

How I Found a Permanent Account Takeover Through SSO Account Link

The application allowed changing the account email without any verification and automatically linked SSO identities based solely on matching email addresses. An attacker with temporary access could change the email to their own, link an SSO account, then restore the original email, leaving a persistent SSO backdoor that survived password resets.

El Professor Qais Follow

Published on medium.com

During a recent security assessment, I discovered a critical vulnerability in a web application that allowed permanent account takeover through an insecure Single Sign-On (SSO) account linking implementation.

El Professor Qais, 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 application treated email addresses as proof of identity, allowing unverified email changes and automatically linking SSO accounts by email match without revoking those links when the email changed again.

Impact

An attacker with temporary access could permanently hijack an account, maintaining access even after password resets or email restoration, and potentially access sensitive data or billing information.

What the attacker needed

Temporary access to victim account; attacker-controlled email address; attacker-controlled SSO account (Google/Apple)

The fix

The application should require password confirmation, MFA, and verification of the new email before changing it, never automatically link SSO identities by email alone, and revoke existing SSO links when the email changes.

How it was found

  1. Register a normal user account and access the dashboard.
  2. Change the account email to an attacker-controlled address without any verification.
  3. Log out and sign in with Apple SSO using the attacker-controlled email, which links to the same account.
  4. Change the email back to the original victim address, again without verification.
  5. Log out and sign in again with the attacker's Apple SSO; access to the victim account persists.

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.

Single sign-on (SSO) lets you log in with another service like Google or Apple. This app trusted that if an SSO account used the same email as an existing account, it must be the same person, and linked them automatically. Because the app also let you change your email without proving you owned it, an attacker could briefly take over an account, attach their own SSO login, and keep access forever.

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 El Professor Qais

View all

5 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.