← Back to Tools

🔐 JWT Decoder & Analyzer

Decode any JWT — inspect the header and payload, and get an automatic vulnerability analysis. The signature is never transmitted; all decoding is done server-side with no external calls.

Paste a JWT (with or without 'Bearer ' prefix). The signature is never transmitted — decoding is local.

⚡ The alg:none Attack — Interactive Demo

See how an attacker forges a JWT by stripping the signature when the server accepts alg:none.

Step 1 — Steal a valid token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyIsInJvbGUiOiJ1c2VyIn0.SflKxwRJSMe…

Attacker intercepts a token belonging to a regular user (role: "user").

Step 2 — Forge a new header + payload
eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0 (alg: none)
eyJzdWIiOiJ1c2VyXzEyMyIsInJvbGUiOiJhZG1pbiJ9 (role: admin)

Changes alg to "none" in the header, role to "admin" in the payload. Both are just base64 — no key needed.

Step 3 — Submit forged token
eyJhbGciOiJub25lIn0.eyJyb2xlIjoiYWRtaW4ifQ.[empty]

If the server accepts alg:none, it skips signature verification — and the attacker is now "admin".

The fix: Always explicitly whitelist allowed algorithms server-side. Never accept alg:none from untrusted input. Use a JWT library that rejects alg:none by default — most modern ones do.

📚 How JWTs Work and Common Vulnerabilities

A JWT (JSON Web Token) is a compact, URL-safe string that carries claims between parties. It has three parts separated by dots: Header.Payload.Signature.

Header — declares the token type and signing algorithm (e.g. HS256, RS256).

Payload — contains the claims: who the user is, their role, when the token expires. This is encoded (base64), not encrypted — anyone can read it.

Signature — a cryptographic hash of the header + payload using a secret key. Prevents tampering — if the server validates it.

Key insight: The payload is public data. Never store passwords, secrets, or sensitive PII in a JWT. The signature only proves the token wasn't modified — it provides no confidentiality.