1 OAuth 2.0 Attack Scenarios
OAuth 2.0 is a widely used authorization framework. Misconfigurations in client or server implementations create several critical attack vectors.
1. redirect_uri bypass:
If the authorization server accepts partial matches or wildcards for redirect_uri, an attacker can redirect the authorization code to their server:
https://auth.example.com/authorize
?client_id=app123
&redirect_uri=https://attacker.com/callback ← accepted if validation is weak2. Missing state parameter (CSRF on OAuth):
Without the state parameter, an attacker can initiate an OAuth flow and trick the victim into completing it, linking the attacker's account to the victim's identity.
3. Token in referrer header:
GET /callback?code=AUTH_CODE&state=xyz HTTP/1.1
Referer: https://victim-site.com/page ← auth code leaks if page has external resources4. Authorization code interception: Without PKCE, authorization codes intercepted in transit can be exchanged for access tokens by an attacker.