Visual RFC.
ALL RFCs / RFC 8725
Read the RFC ↗

RFC 8725 / START HERE

JWT security, before the details

JWT security best practices

JWT means JSON Web Token. This RFC explains checks and design choices needed to use JWTs safely rather than trusting a token merely because it can be decoded.

The idea in one picture

  1. A service receives a token

  2. It checks integrity and context

  3. Only suitable claims are accepted

A simplified picture of the idea; the chapters explain the actual mechanisms.

Why it exists

Weak algorithm choices and confused token contexts can turn a valid-looking token into a security problem.

A familiar example

An API restricts accepted algorithms and checks the token's issuer, audience, and purpose before using its claims.

Helpful background

You can start here without reading another RFC. If these ideas are unfamiliar, these short introductions may help.

What you’ll learn next

Begin with chapter one, or choose a topic.

  1. Do not let alg choose the policyThe receiving application limits acceptable algorithms instead of trusting the token header to decide.
  2. A password is a weak MAC keyHMAC keys need enough entropy; a human-memorable password is not an appropriate substitute.
  3. Nested tokens need every checkAn outer encrypted token does not excuse skipping the inner signature verification.
  4. Bind issuer and audienceA valid signature must be tied to the expected issuer and intended recipient.
  5. Different purposes need different rulesToken kinds sharing an ecosystem must not be interchangeable.
Start with chapter one →

This introduction explains RFC 8725 (2020). Read the original RFC ↗