Skip to content
OAuth / SSO Write-up Intermediate

Forced OAuth Profile Linking Lead to Account Takeover

The OAuth account-linking endpoint accepted a request without a state parameter, so it could be triggered cross-site. An attacker could force a victim's account to be linked to the attacker's own OAuth identity and then log in as the victim.

0xtal3at Follow

Published on medium.com

This is my first write-up on a real target. I found this with my friend 0x3adwy, where I’ll show you how Forced OAuth profile linking leads to an account takeover.

Ahmed Talaat (ItsTal3at), 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 OAuth linking flow did not require or validate a state (CSRF) token, so a cross-site request could bind an attacker's provider account to a victim.

Impact

The victim's account could be taken over, giving the attacker access to all their information and actions.

What the attacker needed

Victim is logged in; victim visits attacker page; attacker has an OAuth account

How it was found

  1. Start the OAuth linking flow and choose Facebook to link an account.
  2. Capture the request that binds the account to the OAuth provider.
  3. Notice the state parameter is absent from the request.
  4. Build a cross-site form that submits the linking request and auto-submits it.
  5. Send it to the victim so their account links to the attacker's Facebook account.
  6. Log in with the attacker's Facebook credentials to access the victim's 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.

When you log in with Google or Facebook, the site should include a random value called a state parameter that it checks when the provider sends you back. Without it, another website can quietly make your browser send the linking request, so your account gets tied to someone else's login.

What is OAuth / SSO?

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.