Skip to content
OAuth / SSO Write-up Advanced

Facebook Oauth token leakage

A Facebook OAuth flow for canvas applications could be redirected to an attacker-controlled application by adding an app_id parameter to the redirect_uri, so the authorisation code was issued to the wrong app. In 2021 the researcher found an endpoint that converted the resulting nonce code into an access token, allowing theft of a victim's token.

abdellah yaala Follow

Published on medium.com

Bounty$7,500 View original

before 3 year this bug is N/A , because we can’t do anything with authorization code not like access token . but in 2021 meta rewarded me 7500$.

abdellah yaala, 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 redirect handling trusted an extra app_id parameter appended to the redirect_uri, so the authorisation code was bound to the attacker's application rather than the one named in client_id.

Impact

An attacker could steal the access token of users of affected canvas applications, though the text does not state what actions the token allowed.

What the attacker needed

Victim opens a crafted OAuth link; attacker owns a Facebook app; target is a canvas app with a username

How it was found

  1. Open a Facebook OAuth dialog URL for a canvas application, using its apps.facebook.com username as the redirect target.
  2. Append an app_id parameter set to the attacker's own application to that redirect_uri.
  3. Observe that Facebook redirects to the attacker application instead of the real one.
  4. Use the discovered endpoint to convert the returned nonce code into an access token.

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 to a site with Facebook, Facebook hands the site a short-lived code that proves who you are. This report says a crafted link could make Facebook hand that code to a different, attacker-owned app instead of the real one. The attacker could then swap the code for a full access token and act as the victim.

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.

More by abdellah yaala

View all

5 more disclosed reports, best first.

More from Meta

View all

The newest disclosed reports for this program.

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.