Verifying JWTs in Node.js: alg none, algorithm confusion, audience checks and clock skew
DEV Community
Verifying JWTs in Node.js: alg none, algorithm confusion, audience checks and clock skew
The JWT checks that get skipped and the attacks they allow: trusting the token's alg header, comparing signatures with ===, forgetting the audience, and missing exp. A small tested HS256 verifier with node:crypto that shows each check, and why production code should still use a maintained library.
0 comments
No comments yet.