Breaking and securing OAuth 2.0 in frontends at NDC Security
summary
Demo web app and attacker server show malicious script steals tokens (exfiltrates access + refresh tokens to attacker domain) and a second demo uses a silent iframe authorization code theft to obtain fresh tokens that bypass refresh token rotation. Claim: running OAuth2 flows in the browser increases attack surface and is repeatedly exploitable. Built proof‑of‑concept code works reliably. Practical fix: adopt a Backend-For-Frontend (BFF) (confidential client, HTTP‑only cookies) which removes most token theft vectors though client‑side XSS still enables request‑forging.
AI-written summary · about
chapters (8)
- 0:00OAuth 2.0 and frontend security
- 10:44Direct OAuth in frontends insecure
- 23:58Refresh token rotation limits
- 29:14OAuth token theft risks demo
- 37:51OAuth frontend vs backend security
- 41:00Backend for Frontend (BFF) pattern
- 56:00BFFs improve OAuth security
- 58:13Key takeaways
related talks
57mThe insecurity of OAuth 2.0 in frontends
53mOAuth2/OIDC security weaknesses and pitfalls
47mTop X OAuth 2 Hacks
01h 02mOpenID Connect & OAuth 2.0 – Security Best Practices
01h 03mSecuring SPAs and Blazor Applications using the BFF (Backend for Frontend) Pattern
33mBreaking Tokens: Modern Attacks on OAuth, OIDC, and JWT Auth Flows
37mHacking OAuth Pitfalls and Remedies
28mOffensive and Defensive Strategies for Client-Side JS Security
