CS FundamentalsHardProduct-company security interview

An API uses self-contained JWT access tokens that are valid for 24 hours and are verified only by signature. A user's laptop is stolen and the account is disabled. What is the weakness, and the common mitigation?

  1. A. None; JWTs are revoked automatically when the account is disabled
  2. B. The token still verifies until it expires; use short-lived access tokens with revocable refresh tokens (or a deny-list checked on use)
  3. C. JWTs cannot be signed, so anyone can forge them
  4. D. The server must store every JWT in a session table, which removes all benefit

Correct answer: B. The token still verifies until it expires; use short-lived access tokens with revocable refresh tokens (or a deny-list checked on use)

Stateless tokens trade revocation for scalability. Keeping access tokens short (minutes) bounds the exposure, and refresh tokens, which are checked against the server, can be revoked.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic