Older JWT libraries chose the verification algorithm from the token's own alg header. With alg: none an attacker removed the signature and the library skipped verification. With RS256/HS256 confusion the attacker took the server's RSA public key (published in the JWKS), used its bytes as an HMAC secret to sign a forged token with alg: HS256, and a library that passed 'the key' to whatever algorithm the header named verified it successfully. Microsoft.IdentityModel ties algorithms to key types (an RsaSecurityKey can't be used to verify an HMAC signature), RequireSignedTokens (default true) rejects unsigned tokens, and you should pin ValidAlgorithms to what your issuer actually uses. Beyond that: get keys from the issuer's metadata rather than configuring them by hand, validate issuer and audience, and never write your own validation.
Checks awareness of classic JWT validation attacks
Last updated 23 Nov 2026.