Working with JSON Web Tokens
JSON Web Tokens (JWTs) are used for authentication, session handling, and authorization of data between systems. JWT vulnerabilities are usually design flaws, misconfigurations, or the use of insecure libraries. When testing for JWT flaws, the tester attempts to bypass the signature verification process, which bypasses the authentication or authorization mechanism. The information sent in the JWTs are called claims and are cryptographically signed JSON objects. Each JWT is made out of three sections; the first is a header, the second is the payload, and the third is a signature. Each section is divided by a .
(dot) and encoded using base64
encoding. The header contains information about the token, the payload section includes the claims, and the signature is usually a hashed value of the header and the payload section combined and used for integrity checks.
In this recipe, you will attack a misconfigured server that issues JWTs to accept unsigned tokens...