Closed hugo-syn closed 3 years ago
Hmm, tricky one.
The reason this fails is because the original token provided uses an unusual JSON syntax in the header:
eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJWLWluY0lORkJRUF9Ucm9MbGZuYUFvdnk0VGgxNUxLQzNBR2IzZFI5cVg0In0
{"alg":"RS256","typ" : "JWT","kid" : "V-incINFBQP_TroLlfnaAovy4Th15LKC3AGb3dR9qX4"}
Specifically having spaces either side of the colons in a couple of places.
As jwt_tool supports modifying tokens the process actually disassembles and reconstructs the tokens (with no spaces between the colons as general JSON conventions). This largely works fine, however in some outliers you make get errors/issues where the original JSON doesn't match the reconstructed JSON.
FWIW the fact that the spacing is inconsistent hints at a bug in the token generation.
Thank you !
Hi, I'm using _jwttool to perform attacks on a JWT token using the RS256 algorithms. I have the public key to check for the signature, but the tool is telling me that the signature is invalid. My token is valid, I can use it on my application and I checked with the PyJWT library which also say that the token is valid. So I'm wondering why the _jwttool.py script say that the signature is not valid.
With the PyJWT library the signature verification suceeds:
Thanks !