JSON Web Tokens (JWT)
3 guides tagged JSON Web Tokens (JWT), grouped by topic, with the SDLC phase and role each is written for.
- SDLC phases
Identity & cryptography
3 guidesJWT validation: algorithms, keys, claims and key rollover
Validate a JWT against a fixed algorithm, trusted keys and the expected issuer, audience and type, reject the known header attacks, and rotate signing keys without accepting arbitrary keys or breaking valid tokens.
Development · Developers
Defend JWTs against forgery, confusion and replay
Verify a JWT as an issuer-, type- and audience-bound assertion with an algorithm allowlist and trusted keys, closing the alg "none", key-confusion, header-injection, weak-secret and replay attacks.
Development · Developers
Case study: Storm-0558 and the forged Microsoft tokens (2023)
How a stolen 2016 consumer signing key and a token validation gap let Storm-0558 read enterprise Exchange Online mail in 2023, and what the review board found about rotation, logging and culture.
Development, Maintenance, Security program · Developers, Platform engineers and SREs
Practice
JWT validation lab: Validate the purpose and audience of a token
An API accepts a correctly signed token intended for another service. Repair claim validation after the trusted signature verifier has finished.
JWT verification lab: Verify a JWT before trusting it
An API decodes the JWT it receives and trusts the claims without checking the signature or the algorithm, so an attacker can forge an admin token with alg "none" or sign one with a key the API never issued. Repair the verifier so it confirms the algorithm and signature first, then the claims.
JWT validation in APIs (bearer tokens)
An API that accepts JWT bearer tokens has to establish, on every request, that the token was signed by the issuer it trusts, with the algorithm it expects, for this API, and that it has not expired.