JWT
HMAC hacking
RSA:
To sign a token, you need the private key.
To verify a token, you can use the public key corresponding to the private key used for the signature.
HMAC,:
To sign a token, you need the secret.
To verify a token, you need the same secret.
To exploit this, we need access to public.pem
, then we can change the algorithm of the JWT token to use HMAC and create a signature using public.pem
.
Because HMAC uses the same key in public.pem
to validate the key, we can forge a valid token.
Last updated