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.
Published on medium.com
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$.
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
- Open a Facebook OAuth dialog URL for a canvas application, using its apps.facebook.com username as the redirect target.
- Append an app_id parameter set to the attacker's own application to that redirect_uri.
- Observe that Facebook redirects to the attacker application instead of the real one.
- 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.