← Quiz: Authentication, Sessions and JWT: all 10 questions
Quiz: Authentication, Sessions and JWT · Question 5 of 10
An attacker changes the role inside a JWT payload from "student" to "admin". What stops this from working?
An attacker changes the role inside a JWT payload from "student" to "admin". What stops this from working?
- A.The payload is encrypted
- B.The signature no longer matches, and the attacker cannot make a new one without the server's secret
- C.Browsers block edited tokens
- D.JWTs cannot contain roles
Answer & explanation
Correct answer: The signature no longer matches, and the attacker cannot make a new one without the server's secret
The signature covers header and payload, so any change is detected on verification.
Can you get the rest right without peeking?
Take the timed Quiz: Authentication, Sessions and JWT quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →