Skip to content
Account takeover Write-up Intermediate

OAuth: How a Simple Misconfiguration Can Lead to Full Account Take

The OAuth login flow returned a token containing the user's email and name in plain text, and the server accepted a tampered email without any validation or signature check. An attacker could change the email to a victim's address and receive a valid access token for that victim, leading to full account takeover.

mo.muwafak2001 Follow

Published on medium.com

I want to share a easy account takeover I recently found. I was able to perform a full account takeover via Sign In with OAuth.

MUWAFAK HELAL, 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

An attacker could obtain a valid access token for any user's email and fully take over their account.

What the attacker needed

A Google account to log in; ability to intercept and modify requests; victim's email address

How it was found

  1. Log in to the site using Google OAuth.
  2. In Burp history, filter for requests containing '@gmail.com' to find the OAuth token request.
  3. Observe that the token is a JSON object with plain-text email and name.
  4. Send the request to Repeater and replace the email with the victim's email.
  5. The server returns a valid access token for the victim's email.
  6. Use Burp Match and Replace to swap your token with the victim's token and log in as the victim.

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.

OAuth is a way to log in using another service like Google. The server should check that the login data really came from Google, but here it just trusted whatever email was sent. By changing the email to someone else's, the attacker got logged in as that person.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by mo.muwafak2001

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.