
JSON Web Tokens (JWTs) carry identity and permissions between a client and an API. They are signed, not encrypted, and their security depends entirely on how the server validates them. Small validation mistakes let an attacker forge a token and become any user.
Common mistakes include accepting the none algorithm (no signature at all), accepting weak algorithms, confusing public-key and shared-secret algorithms, and trusting header fields like jku or kid that tell the server where to find the key. Each one lets an attacker craft a token the server accepts.
none and weak algorithms.exp, aud and iss.none algorithm, weak algorithms, algorithm confusion, and jku and kid header abuse.Some libraries accept tokens that declare the algorithm "none", meaning no signature. An attacker can then forge any token the server will accept.
Pin the expected algorithm on the server, verify the signature with a trusted key, and check exp, aud and iss on every request.
Try Vooki Pro free for 7 days
If your API uses JWTs, test the validation before someone forges a token. The trial unlocks every feature for 7 days, and scanning runs on your own machine.
Related: Cross-site request forgery (CSRF) · Insecure deserialization