Skip to content
OAuth / SSO Write-up Intermediate

Broken OAuth Linking

The application's Facebook account linking feature did not validate the short-term access token against the provided Facebook ID, allowing an attacker to link any victim's Facebook account to their own by sending a dummy token. When the victim later logged in via Facebook, they were logged into the attacker's account, enabling shipping fraud and theft of bank account information.

medium.com

Published on medium.com

Hi hackers, I’m Mahmoud Barkat (aka brbr0s) a bug hunter who’s always trying to learn more and get better at what he does.

brbr0s, 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

Impact

When the victim logs in using Facebook OAuth as normal, they are logged into the attacker’s account, allowing the attacker to commit shipping fraud and steal the victim’s bank account information.

What the attacker needed

Attacker has an account; Victim's Facebook ID is known; Victim logs in via Facebook

How it was found

  1. Attacker creates a normal account with email/password.
  2. Attacker intercepts the Facebook linking request.
  3. Replaces the facebookId with a known victim’s ID (which is already in public).
  4. Sends the request with dummy token-word.
  5. Facebook ID is unlinked from the victim’s original account and bound to the attacker’s.
  6. Victim logs in normally via Facebook -> gets routed into attacker’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 link a Facebook account to another app, the app should check that the Facebook ID and the temporary token belong together. Here, the app accepted any token, even a fake one, so an attacker could link someone else's Facebook account to their own account. Then, when the victim logged in with Facebook, they ended up in the attacker's account.

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.