Skip to main content

Pentrova is launching soon. Join the waitlist for early access.Join the waitlist

Glossary · Crypto

JSON Web Token (JWT)

A compact signed token format used to assert claims between parties, popular for stateless auth and notorious for implementation defects.

Explainer

What it is#

A is three base64url-encoded segments separated by dots: a header describing the algorithm, a payload containing claims, and a signature over the first two. Libraries verify the signature, parse the claims, and hand them to the application. The format is well specified in RFC 7519, but the ecosystem of libraries around it has produced a long catalog of implementation bugs.

Why it matters#

JWTs are the default session token in most modern APIs. A bypass in the verification logic frequently translates into a full authentication bypass across every authenticated route. Attackers target three recurring flaws: alg=none acceptance, HS256/RS256 key confusion, and unverified kid headers that let the token pick its own signing key.

Mitigation direction#

Hard-code the accepted algorithm on the verifier. Never let the token’s header dictate the key or the algorithm. Use audience and issuer claims, enforce short expirations, and rotate signing keys with a schedule that does not require a library upgrade to honour.

  • Mutual TLS (mTLS)

    An extension of TLS where both server and client authenticate each other with X.509 certificates, common for service-to-service auth in zero-trust.

  • OAuth 2.0 (OAuth2)

    A delegated authorisation framework specified in RFC 6749 that lets a third-party client access a user's resources without holding the user's password.

← Back to the glossary

Site search

↑↓ navigateEnter openEsc close