Skip to content
OAuth / SSO Write-up Intermediate

Four Redirects, One URL, Full Account Takeover: An OAuth Chain Au

Multiple OAuth implementations used imprecise string comparisons (wildcards, prefix matches, regex) to validate redirect_uri, allowing attackers to redirect authorization codes or tokens to attacker-controlled sites and achieve account takeover. The article also describes a Reddit chain where response modes were not restricted, enabling token leakage via window.name.

Raj Namdev Follow

Published on medium.com

In April 2014, a researcher named melvin reported that a Meteor-built app called Respondly had an open redirect in its Twitter OAuth flow — “obtaining the OAuth token and verifier of the victim,” as the report puts it. A month later, the OAuth working group published Security Advisory 2014.1 and gave the pattern a…

Raj Namdev, 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 redirect_uri validation used pattern matching (wildcards, prefix checks, regex) instead of exact string comparison, and some flows failed to restrict response modes or strip fragments.

Impact

Attackers could steal OAuth tokens or authorization codes and achieve full account takeover, though some reports note that exact bounty amounts and severity ratings were not independently re-confirmed.

What the attacker needed

Victim clicks a link; attacker controls a redirect endpoint; OAuth client uses flawed redirect_uri validation

The fix

OAuth implementations should use exact string matching for redirect_uri and restrict response modes to those expected by the client.

How it was found

  1. Attacker crafts a URL with a redirect_uri that passes the flawed validation but points to an attacker-controlled endpoint.
  2. Victim clicks the link and authenticates with the OAuth provider.
  3. The provider redirects to the attacker's endpoint with the authorization code or token.
  4. Attacker exchanges the code for an access token and takes 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 websites to let you sign in with another service, like 'Log in with Google'. The service sends a secret code back to the website, but only if the website's address matches exactly what was registered. If the check is sloppy, an attacker can trick the service into sending the code to their own site, letting them log in as you.

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 Raj Namdev

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.