Practice library / Web attacks
Lab · Medium · 2 hoursFree account
OAuth & JWT Attacks
alg:none bypass, RS256→HS256 confusion, JWT cracking, and OAuth code theft.
On this page 6 sections
Before you start
A JSON Web Token carries its own claims and signs them — change the header's alg to none or to HS256 with the server's public key and a weak implementation accepts whatever body you sign. OAuth adds a redirect-based dance on top, and a missing state parameter or a loose redirect_uri lets an attacker steal the code mid-flow. Here you forge tokens, crack HMAC secrets and steal an OAuth code.
Lab Objectives
- Decode and understand JWT structure and signature verification
- Exploit algorithm=none to forge tokens without a secret
- Exploit HMAC-RSA confusion (RS256 to HS256) attacks
- Brute force weak JWT secrets with hashcat
- Attack OAuth 2.0 authorization code flows
- Exploit OAuth CSRF via missing state parameter and open redirect_uri
Topics Covered
- JWT header, payload, and signature breakdown
- alg:none attack — unsigned token forgery
- RS256 to HS256 key confusion attack
- JWT secret cracking with hashcat and jwt_tool
- OAuth 2.0 flows and implicit grant vulnerabilities
- OAuth CSRF and redirect_uri manipulation for code theft
Sign in to continue
5 more sections are for signed-in members. It is free: sign in with Google.