JWT Security Pitfalls: alg:none, Weak Secrets, and Missing Validation
The most dangerous JWT implementation mistakes: the alg:none attack, symmetric/asymmetric key confusion, and missing expiry checks.
Published:
Tags: security, jwt, mistakes
JWT Security Pitfalls: alg:none, Algorithm Confusion, and Weak Secrets JSON Web Tokens have a design that gives developers dangerous choices. The algorithm used to sign the token is specified inside the token itself — in the header that the token's recipient reads before verifying the signature. This "helpful" feature has led to a class of attacks that have compromised real applications. Combined with the use of weak or short secrets, JWT implementations frequently fail in ways that are subtle and hard to detect without deliberate testing. Pitfall 1: The alg:none Attack The JWT specification defines as a valid option meaning the token has no signature. The intent was to allow unsigned tokens in contexts where they are secured by other means (e.g., a direct channel that guarantees…
All articles · theproductguy.in