JSON Web Token (JWT) Secret Key Brute Force

JSON Web Token (JWT) is a JSON-based open standard (RFC 7519) for creating access tokens that assert some number of claims. For example, a server could generate a token that has the claim "logged in as admin" and provide that to a client. The client could then use that token to prove that he/she is logged in as admin. The tokens are signed by the server's key, so the server is able to verify that the token is legitimate. The tokens are designed to be compact, URL-safe and usable especially in web browser single sign-on (SSO) context.

More Information


The JWT standard follows the JSON Web Signature (JWS) specification to generate the final signed token. It is generated by combining the encoded JWT Header and the encoded JWT Payload, and signing it using a strong encryption algorithm, such as HMAC SHA-256. The signature’s secret key is held by the server so it will be able to verify existing tokens and sign new ones.


The secret signing key used to verify tokens should only be accessible by the issuer and the consumer; it should not be accessible outside of these two parties. If the secret signing key used for calculating and verifying the signature is set to a weak string, it is possible to guess or brute force these values and craft a JWT token. Try to log into the following application as a 'admin' user.