Skip to content
OAuth / SSO Write-up Intermediate

The Oauth Misconfiguration

The Android app accepted a Facebook access token supplied by the client without validating it on the server side. An attacker could substitute their own token and take over another user's account.

c0d3x27 Follow

Published on infosecwriteups.com

OAuth 2.0 is an authorization framework for Web Application. It validates the identity of a user to the website which requested it without disclosing passwords to the website.

c0d3x27, on infosecwriteups.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 server trusted the client-supplied Facebook access token and never verified it against Facebook or checked which user it belonged to.

Impact

An attacker could take over any user's account by swapping in their own access token, and the same code powered both the Android and web apps.

What the attacker needed

A Facebook account; ability to intercept app traffic; a target account to take over

The fix

The server should validate the Facebook access token and confirm it belongs to the user, as described in Facebook's login security guidance.

How it was found

  1. Capture the login request that carries the Facebook access token.
  2. Replace the original token with your own malicious access token.
  3. Send the modified request to take over the targeted 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 Facebook, Facebook gives the app a short code called an access token that proves who you are. This app trusted whatever token the phone sent without checking with Facebook that it really belonged to that user. So an attacker could send their own token in place of the victim's and be let into the victim'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.

More by c0d3x27

View all

9 more disclosed reports, best first.

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.