Skip to content
OAuth / SSO Write-up Intermediate

The $12,000 Redirect, a Misconfigured URL

The OAuth authorisation server did not validate the redirect_uri parameter, allowing any URL to be used. An attacker could craft a link that, after the victim logs in, sent a valid authorisation code to the attacker's server, which could then be exchanged for an access token and lead to full account takeover.

dhirenkumar Follow

Published on medium.com

There’s a unique kind of adrenaline that comes with bug bounty hunting. Not the Hollywood-style hacking suspense, but the quiet kind the thrill of finding something subtle, buried in the code, that everyone else missed.

Dhiren Kumar Pradhan, 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 server failed to validate the redirect_uri against a whitelist for the client, allowing arbitrary redirect destinations.

Impact

An attacker could craft a phishing link that, after the victim logs in via the legitimate auth page, silently harvested their access token, leading to full account takeover without user interaction.

What the attacker needed

Victim clicks a link; victim logs in via legitimate auth page; attacker controls a server

The fix

The OAuth server should strictly validate the redirect_uri against a pre-registered whitelist for each client.

How it was found

  1. Log in to a test account and inspect the OAuth login flow.
  2. Modify the redirect_uri parameter to point to an attacker-controlled server.
  3. Complete authentication and observe the browser redirect to the attacker server.
  4. Capture the authorisation code on the attacker server.
  5. Send a token request to the /token endpoint using the mobile client ID and the stolen code.
  6. Receive a fully scoped access token tied to the victim 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 common way for apps to let you log in with another service. The app sends you to a login page and then back to the app with a special code. If the app does not check where it sends you back, an attacker can trick you into sending that code to their own server, which they can then swap for access to 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.

More by dhirenkumar

View all

3 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.