awesome-everything RU
↑ Back to the climb

Security

JWT pitfalls: multiple-choice review

Crux Multiple-choice synthesis across the JWT-pitfalls unit — alg:none, RS256-to-HS256 confusion, claim validation, revocation, and token storage tradeoffs.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 13 min

Six questions that cut across the whole unit. Each one mirrors a real verification decision — not a definition to recite, but a trust boundary to defend under an attacker who controls the token.

Goal

Confirm you can connect the JWT failure modes — algorithm trust, key binding, claim checks, revocation, and storage — into one rule: never let the token describe how it should be verified.

Quiz

A library version accepts a token whose header is alg:none with an empty signature segment and returns valid. Why is this catastrophic, and what is the one-line fix?

Quiz

In the RS256-to-HS256 confusion attack, what is the secret the attacker signs the forged token with, and why does the server accept it?

Quiz

A service correctly pins alg:RS256 and verifies the signature, but a token minted for a different microservice in the same trust domain is accepted as its own. Which claim check is missing?

Quiz

A token's header carries a kid that points at https://attacker.example/jwks.json, and the server fetches the key from that URL to verify. What is the failure, and the fix?

Quiz

A user reports their session was hijacked. With a stateless JWT, why can't you log them out server-side, and what bounds the damage?

Quiz

A SPA must survive page refreshes. Which storage split does a security-minded senior ship, and why?

Recap

The through-line across the unit is one rule: never trust the token to describe its own verification. alg:none and RS256-to-HS256 confusion both die when you pin an explicit algorithm allowlist and bind each key to one algorithm; attacker-controlled kid/jku die when you resolve keys only against a pinned allowlist. A valid signature is necessary but not sufficient — check aud and iss so a token is scoped to THIS service. And because a stateless token cannot be un-issued, short access TTLs, refresh-token rotation with reuse detection, and XSS-aware storage bound whatever leaks.

Continue the climb ↑JWT pitfalls: free-recall review
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.