Module lessons (2/3)
Exact redirect_uri Pinning & Token Leakage
Bypass prefix redirect validation, then enforce canonical HTTPS origin+pathname equality and Referrer-Policy safeguards.
What you'll learn in this lesson
- Exploit prefix and wildcard bugs in OAuth
redirect_urivalidation that allow attackers to stealcodetokens. - Implement strict canonical URI equality matching (
origin + pathname) overhttps:with zerouserinfo, fragments, or path smuggling. - Prevent authorization code leakage via HTTP
Refererheaders, open redirects on?next=, and third-party callback scripts.
Overview
Authorization servers deliver the single-use code directly to whichever redirect_uri passes validation. Whenever engineers write uri.startsWith('https://app.acme.test/oauth') or permissive regex host globs, attackers redirect the authorization code straight to their own server:
OAuth 2.1 mandates exact pre-registered URI equality — zero substring checks, zero wildcards, zero path normalization tricks.
Sections covered in this lesson
- 11. Redirect URI Parsing Pitfalls & Callback Isolation
- 22. Interactive Explorer: Hardened OAuth Flow & Redirect Boundaries
- 33. Progressive Labs: Warm-Up → Attack → Defend → Harden
- 44. Checkpoints & Code Review
Unlock "Exact redirect_uri Pinning & Token Leakage" and the full Application & Web Security curriculum
Bypass prefix redirect validation, then enforce canonical HTTPS origin+pathname equality and Referrer-Policy safeguards.
Unlock all 6 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Application & Web Security plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.