Login? Who Needs That? Bypassing OAuth Like a Lazy Hacker on Sun
An OAuth authorisation endpoint on a development authentication host did not properly validate the redirect_uri, so an attacker could send a crafted authorisation link that delivered the victim's authorisation code to a domain the attacker controlled. The attacker could then exchange that code for access tokens and use them to read other users' profile data and reach internal admin functionality.
Free Link🎈
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 authorisation endpoint accepted an arbitrary redirect_uri without validating it against a registered allowlist, and the state parameter was not enforced.
Impact
The attacker could obtain valid access tokens, impersonate users, view other users' personal data including emails and phone numbers, and reach admin dashboard links and billing data; the text claims no user interaction was needed beyond the victim clicking the initial link.
What the attacker needed
Attacker-controlled OAuth app; victim clicks a crafted authorisation link; exposed dev auth endpoint
How it was found
- Find an exposed OAuth callback endpoint on a development authentication host during subdomain reconnaissance.
- Send a test request to the callback with arbitrary code and state values and observe a redirect.
- Register an attacker-controlled OAuth app with a redirect URL the attacker controls.
- Replace the legitimate redirect_uri in the authorisation URL with the attacker's URL and force a login attempt.
- Capture the authorisation code delivered to the attacker's domain and exchange it at the token endpoint.
- Use the resulting bearer token against internal APIs to read user profiles and admin settings.
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 Google or a similar provider, the site sends you to a login page and then back to an address it trusts, carrying a short-lived code. If the site does not check that the return address is one of its own, an attacker can make the code come back to their own site instead. The attacker swaps that code for an access token, which is like a temporary key that lets them act as the victim.
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.