Skip to content
RED SAGSkills
hard20 pts · first answer countsjwtauthenticationweb-security

JWT algorithm confusion

Tokens are signed with RS256. The API verifies them with jwt.verify(token, publicKey) and lets the library use whatever alg the token header says. An attacker forges tokens by signing with HS256 using the public key as the HMAC secret. What is the correct fix?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions