One Token, Two Apps: The OAuth Flaw That Can Compromise Your Acco
App A accepted a Google access token that had been issued to a different application, App B, and created a session for the token's owner. An attacker holding a stolen token from App B could therefore log in as that user on App A without going through App A's own OAuth flow.
Published on medium.com
Understanding the Risks of Reusing OAuth Access Tokens in Vulnerable Applications:
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 application trusted any valid Google-signed access token and never checked which client the token was issued to (for example via the token's audience or authorised party).
Impact
An attacker who obtains a user's token from App B could gain full access to that user's account on App A, though the text notes the token must first be stolen through phishing, XSS, insecure storage or network interception.
What the attacker needed
Victim has accounts on both apps; attacker obtains the victim's App B token; both apps use the same identity provider
The fix
The application should validate that the access token was issued for it, not merely that Google signed it.
How it was found
- Log in to App B with Google and capture the access token App B receives.
- Start the Google login on App A and find the request where App A creates its session from the Google access token.
- Replay that request using App B's access token instead of App A's.
- Observe that App A accepts the token and issues a valid session for the same 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.
When you click 'Log in with Google', Google gives the app a short-lived pass (an access token) that proves who you are. Each pass is meant for one specific app. Here, a second app accepted a pass that Google had made for a different app, so anyone who stole such a pass could use it to sign in as you on that second app.
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.