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
- Stored versus reflected XSSFull Stack Developer
- Writing location.hash into the pageFull Stack Developer
- Encoding user text inside HTMLFull Stack Developer
- What the Secure cookie flag doesFull Stack Developer