hackweb
notes on hacking and technology
IT EN
main menu
user menu
you are not logged in

OAuth 2.0: the recurring pitfalls

December 16, 2025 · 1 min read · #authentication #oauth #web

OAuth 2.0 issues access tokens to third parties. It is an authorization protocol; using it as login requires OIDC. The errors live at the edges.

The classics

Loose redirect_uri: if the server accepts partial or wildcard redirects, the attacker diverts the code to their own domain. Exact match, always.

Missing state: without a session-bound state parameter, the flow is CSRF-able (forced login). It is OAuth's anti-CSRF token.

Implicit flow: a token in the URL fragment ends up in history, referer, logs. Use Authorization Code + PKCE.

Defence

Authorization Code with PKCE even for confidential clients, exact-match registered redirect_uri, verified state, minimal-scope short-lived tokens. Validate aud and iss on tokens you accept.


« back to home

latest posts
 
your IP address:
216.73.216.108
visitor #0
MOTD:
Every abstraction leaks somewhere.
Here we look at where.
topics