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?
Discussion 0
Join free to post in the discussion.
Related questions
- Storing user passwordsFull Stack Developer
- What HttpOnly doesFull Stack Developer
- What HTTPS protectsFull Stack Developer
- Caching a bank statement pageFull Stack Developer
- JWT in localStorageFull Stack Developer
- CSRF with cookie sessionsFull Stack Developer
- Users see each other’s profileFull Stack Developer
- User bios rendered as HTMLFull Stack Developer