JWT and OAuth token attack playbook. Use when validating token trust, signing algorithms, key handling, claim abuse, bearer flows, and OAuth account-binding weaknesses.
Detected risks:
An expert offensive-security playbook for attacking authentication tokens, JSON Web Tokens (JWT) and OAuth 2.0 flows, during authorized testing. It focuses on token trust decisions: how signatures are validated, how signing algorithms and keys are handled, how claims can be abused, and how bearer tokens leak. It opens with JWT anatomy (header, payload, signature) and quick base64 decode commands, then lists common claim targets used to escalate privileges such as role, isAdmin, sub, permissions, and tier.
The JWT attacks are organized by class: algorithm confusion via alg:none (empty-signature forgery), RS256-to-HS256 key confusion (signing an HMAC token using the server's public key as the secret), brute-forcing weak HMAC secrets, kid header injection (SQL injection or path traversal to control the verification key, for example reading /dev/null for an empty key), and jku or x5u header injection pointing verification at an attacker-hosted JWKS. Concrete tooling is referenced throughout, including jwt_tool (with flags like -X a, -X k, -X s), hashcat mode 16500, john, and Burp's JWT Editor. The OAuth section covers missing or predictable state leading to CSRF and account takeover, redirect_uri bypasses (open redirect, partial-path and prefix matches, localhost and oob), implicit-flow token theft via URL-fragment leakage, and scope escalation during token exchange. A token-leakage section details Referer-header and server-log exposure when tokens travel in URLs, and the file ends with a JWT testing checklist.
The material is explicitly framed for authorized security work such as penetration testing, bug bounty, and red-team engagements, and treats tokens and claims as sensitive. It cross-references companion skills for OAuth/OIDC misconfiguration, CORS issues, and SAML SSO assertion attacks, so it can route to adjacent authentication testing when a target's trust model extends beyond plain JWT and OAuth. It is a hands-on attack reference rather than a defensive hardening guide, though each attack implies the corresponding fix.
JWT cryptographic attacks (alg:none, RS256 to HS256 key confusion, secret brute force, kid and jku/x5u injection) and OAuth 2.0 flow attacks (state CSRF, redirect_uri bypass, implicit-flow token theft, scope escalation), plus token leakage vectors.
jwt_tool for automated JWT attacks, hashcat (mode 16500) and john for cracking weak HMAC secrets, and Burp Suite's JWT Editor, alongside manual commands.
When a server accepts an algorithm switch, you tell it the token is HS256 and sign the HMAC using the server's discoverable RSA public key as the secret, so verification passes on a forged token.
It is an offensive attack playbook for authorized testing (pentest, bug bounty, red team); it treats tokens as sensitive and each attack implies its defensive fix, but it is not a hardening guide.
It cross-references companion skills for OAuth/OIDC misconfiguration (redirect URI, state, nonce, PKCE, account binding), CORS misconfiguration, and SAML SSO assertion attacks.
Quick Setup:
.claude/skills/Repository
yaklang/hack-skills