Q24: What is a JWT Replay Attack and how do `jti` claims and nonces mitigate it?
A Replay Attack occurs when an attacker intercepts a valid signed JWT transmitted across a network and retransmits it multiple times to unauthorized API endpoints.
Mitigation Strategies:
- Short Expiration Times (
exp): Reduces the time window during which intercepted tokens remain usable. - Unique Token Identifiers (
jti): Auth server includes a unique UUID inside thejticlaim. API gateways record usedjtitokens in a cache (e.g., Redis) and reject duplicated submissions. - Client Nonces (
nonce): Used in OIDC to bind the authorization request to the resulting ID token signature.
Key Takeaways
Replay attacks involve retransmitting intercepted valid tokens.
Use unique
jticlaims and short token expiration lifetimes to block token replay.