A server issues HS256-signed JWTs and rejects any token whose edited payload is not re-signed. The tester holds one valid token. Which approach BEST forges an admin token?
Show the answer
Correct answerA. Recover the signing secret offline with a wordlist, then re-sign
AWhy this is right: HS256 is symmetric, so a weak secret can be cracked offline from one token and then used to sign any claims.
BWhy not this: Algorithm confusion relies on a server using RS256 with a public key; this token is HS256 and has none.
CWhy not this: The server verifies the signature, so changed claims with the old signature are rejected.
DWhy not this: Replaying the token only impersonates its owner; it cannot produce admin claims.
HS256 uses a shared secret, so a weak secret can be guessed offline against the captured token. Once recovered, the tester can sign any claims. Algorithm confusion needs an asymmetric scheme with a public key, which this token does not use.