JWT implementation flaws meaning, in plain words

JWT implementation flaws let a login token be forged when signatures or keys are handled loosely. The threats RFC 8725 names, and what to ask your developers.

Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated

JWT implementation flaws are flaws in handling the login token loosely so that it can be forged. JWT stands for JSON Web Token. RFC 7519 defines it as a compact way to represent claims, such as who someone is, exchanged between two parties in a form that can be carried in a URL, and as a format that can be protected by signature or encryption.

How do JWT implementation flaws work?

Picture an employee ID stamped with the issuing company's seal. If reception checks the seal, a forged ID will not pass. If the check is skipped, or a seal anyone can apply is accepted, a fake ID gets through.

The same can happen with a JWT. RFC 8725 lists as known threats libraries with insufficient signature verification, weak keys that are easy to guess, and tokens reused in a situation other than the one they were issued for. It also describes cases in which a specification that lets verification be skipped is accepted as it is.

As a measure, RFC 8725 advises that the calling side be able to specify which algorithms are allowed. It also lists rejecting the whole token if any one cryptographic operation fails to verify, and checking the issuer and the audience. If you are unsure about the design around login, contact us.

Why do JWT implementation flaws matter?

A JWT is sometimes used as a pass after login on member sites and in app APIs. The pass carries claims about the user's identity and permissions. If the check on that pass has a gap, it may be possible for someone to act with the rights of a real user.

Because a site seems to work once a library is added, a hole in the check is easy to miss. Whether the check follows the specification cannot be told by using the screens.

If you built member features with an outside login library, ask your developer whether the settings from installation are still in use and whether the checks above are in place.

Related terms

Frequently asked questions

If I use JWT, is my login safe?

Not necessarily. A JWT is a container format, and whether it is safe depends on how it is handled, such as signature verification and key management. RFC 8725 lists libraries with insufficient signature verification, among others, as known threats.

What should I look at to see whether JWT is handled correctly?

Four points: whether the signature is always verified, whether the allowed signing methods are limited, whether the key is hard to guess, and whether the issuer and the audience are checked. If you have a login feature built in-house, ask your developer to confirm these four.

Next step

The points to check are collected on the JWT implementation flaws vulnerability page. The free URL check looks only at what is visible from outside, so contact us to have your login feature reviewed.

Frequently asked questions

If I use JWT, is my login safe?

Not necessarily. A JWT is a container format, and whether it is safe depends on how it is handled, such as signature verification and key management. RFC 8725 lists libraries with insufficient signature verification, among others, as known threats.

What should I look at to see whether JWT is handled correctly?

Four points: whether the signature is always verified, whether the allowed signing methods are limited, whether the key is hard to guess, and whether the issuer and the audience are checked. If you have a login feature built in-house, ask your developer to confirm these four.

See what an attacker can see, today

The free URL check returns a grade in under a minute. For costs and next steps, book a free consultation.