OAuth: A Backdoor in Disguise — a $7500 Study Case
The application's OAuth implementation allowed reuse of authentication codes and passwords, and failed to verify the JWT signature, so the user identifier could be altered. A separate user enumeration endpoint leaked OAuth IDs, enabling an attacker to impersonate any user who had logged in via OAuth.
In a recent security assessment, I uncovered two critical vulnerabilities in an application’s authentication system, both related to weak OAuth implementation. The application, used for planning and social media management, had serious flaws in its use of Oauth ID for authentication, leading to a payout of $7,500.
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 server did not verify the JWT signature and accepted reusable authentication codes, while a separate endpoint exposed user identifiers.
Impact
An attacker could impersonate any user who had logged in via OAuth, effectively bypassing authentication and taking over accounts.
What the attacker needed
Victim has logged in via OAuth; attacker has a valid account
The fix
The vulnerabilities were resolved according to the timeline.
How it was found
- Log in to the application via OAuth to obtain a valid bearer token.
- Send a POST request to the user endpoint with the target user's email to retrieve their OAuth ID.
- Modify the JWT's subject claim to the target's OAuth ID and re-encode the token.
- Use the modified token to authenticate as the target user.
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. The app trusted a token without checking it was genuine, so someone could change the user ID inside it and pretend to be you. A second bug let anyone look up other users' IDs, making the first bug easy to exploit.
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.