I'm currently exploiting the vulnerability discussed here
https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
Where the algorithm type in JWT can be changed from RSA to HMAC and signing the token with a given public key.
However, I wrote the below python code:
import jwt
import base64
# consider 'publickey' as the servers public key
code =
jwt.encode({'login':'test'},'publickey',algorithm='HS256')
This Throws an error :
InvalidKeyError: The specified key is an asymmetric key or x509 certificate and should not be used as an HMAC secret.
Im looking for an alternative where I can successfully sign it using the asymmetric key.
Thanks