Skip to content
OAuth / SSO Write-up Intermediate

Exploiting Misconfigured Oauth To Takeover Accounts

Two OAuth misconfigurations were found: one app lacked the state parameter but was protected by a custom auth header, while another accepted arbitrary redirect_uri values, allowing token theft. A second app had a properly configured redirect_uri but an open redirect endpoint that could be chained to steal OAuth tokens.

Akash Methani Follow

Published on infosecwriteups.com

Hi, in this writeup I will talk about two misconfigured OAuth flaws I found while looking for bugs, without further ado let’s begin.

Akash Methani, 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 OAuth implementation did not validate the redirect_uri parameter against an allowlist, and in the second case an open redirect endpoint allowed bypassing the allowlist.

Impact

An attacker could steal OAuth tokens and take over victim accounts, but the first flaw was mitigated by a custom auth header, and the second required an active session with the OAuth provider.

What the attacker needed

Victim has active session with OAuth provider; victim clicks a link; attacker has an account

How it was found

  1. Attacker creates an account and initiates OAuth flow, capturing the authorization code.
  2. Attacker sends the crafted link with the code to the victim.
  3. Victim visits the link, linking attacker's social media account to victim's account.
  4. Attacker logs in using the linked social media account to take over the victim'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.

OAuth is a way for apps to let you log in using another service, like Google. A misconfiguration in how the app handles the redirect after login can let an attacker steal the login token and access your 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.