JWT Decoder & Analyzer
What the analyzer checks
- Algorithm. Flags alg none, missing alg, and explains the algorithm confusion risk for RS256 and HS256 verifiers.
- Weak secrets. Tests HMAC tokens against a small wordlist of default and tutorial secrets in your browser.
- Lifetime. Reports missing exp, expired tokens, and lifetimes longer than one day or 30 days.
- Header injection. Flags jku, x5u, and jwk headers and suspicious kid values that lead to key injection, path traversal, or SQL injection.
- Claims hygiene. Flags missing iss, aud, sub, and jti, and highlights sensitive data or authorization claims stored in the payload.
JWT security checklist for developers
- Pin one algorithm in the verifier. Never read alg from the token to choose the verification method.
- Use a random secret of at least 256 bits for HS256. Use RS256 or ES256 when more than one service verifies tokens.
- Set exp on every token. Keep access tokens under one hour and use refresh tokens that the server can revoke.
- Validate iss and aud on every request.
- Treat kid as an opaque lookup key. Never build a file path or a query from it.
- Keep secrets and personal data out of the payload. The payload is readable by anyone who holds the token.
- Store tokens in HttpOnly, Secure, SameSite cookies when the client is a browser.
Common JWT attacks
- alg none
- The attacker sets alg to none, removes the signature, and edits the payload. Vulnerable libraries accept the token as valid.
- Algorithm confusion
- The server expects RS256 but accepts HS256. The attacker signs a forged token with the public key as the HMAC secret and the server verifies it with the same key.
- Weak HMAC secret
- Offline cracking tools test billions of candidate secrets per second against a captured token. Short or dictionary secrets fall in minutes.
- Key injection through jku, jwk, or kid
- The attacker points the verifier at a key that the attacker controls, or abuses kid to read an arbitrary file or run SQL.
Frequently asked questions
Keep exploring
Start testing in minutes
Connect your GitHub repos and domains, and get fully set up in a few clicks.
