pentesting, updated
Testing for OAuth weaknesses
Check the OAuth/OIDC flow for a missing or reusable state parameter, a loose redirect_uri check, and token leakage.
Goal
Confirm the OAuth flow resists CSRF, authorization code theft and open-redirect-style abuse.
How to test
Walk the authorization code flow and check each parameter:
https://auth.example.com/authorize?response_type=code&client_id=app&redirect_uri=https://example.com/callback&state=abc123
state— missing or predictablestateopens the flow to login CSRF. Try the flow withstatestripped or reused.redirect_uri— try a variant (https://example.com.evil.com, an open path on the real domain, a subdomain you control) and see whether the server validates it strictly.- Token exposure — is the access/ID token or code passed in the URL (logged, referrer-leaked) instead of the body/fragment?
What to look for
A flow that accepts a loosely-matched redirect_uri, works without state, or leaks the authorization code/token somewhere it shouldn’t be (logs, Referer, browser history).
References
- OWASP WSTG-ATHZ-05 — Testing for OAuth Weaknesses.