-
-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning about possible security issue #472
Comments
I do not see how this would work:
|
Does this make more sense? I agree that I'm pushing a bit of what is not perfectly done (i.e. key generation) but it is not impossible and not incorrect I think |
Making public a shared secret used for HS* is wrong. Consequently, re-using a (published) public key for HS* is wrong. Bluntly, I see no point in your scenario. |
And this is why I ask the question, should HS* and RS* (or simply asym / sym) algorithm authorized to be set together. Maybe I'm understanding it wrong but I don't see a good reason to have both HS*/RS* allowed in a |
OK, I understand your point now. A public key argument does not make sense for HS* I agree that the interface could be improved, see also #408 (comment) |
this is scenario is also explored in this article: https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/ |
Has something changed on PyJWT (I haven't followed the evolution of the package recently)? |
don't think so but the company sponsoring the lib also published an article explaining the issue and specifies on the lib section to use min 1.0.1 as they addressed it in there forcing a user to specify the algorithms when decoding |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
Late to the party but just in case anybody else reads this chain: what an argument... The security issue is not as described. Bluntly, the security issue is only the trusted key? If you use HS you are at risk because it's a shared key and someone could compromise it. That is the man-in-the-middle attack described above, but that requires compromising the network to accomplish the MitM attack, AND knowing what is the secret. Because the audience is not going to use a new secret the MitM is claiming, it's gonna use the real secret. And if you use RS as you ALWAYS should, then you can't sign something with the issuer private key. FYI: HS was only intended as an easy by-pass for PKI when everything is internal. The audience expects HS or RS as defined in the environment architecture, it should never switch. |
Hello,
As you all know, JWT provides different way to encode and decode a token. Some of those algorithm are asymmetric and others symmetric. The fact that you can have both of them working together create a breach if you can access the public_key.
I'd like to know what you think about the idea of having a warning, or not allowing it at all, to have both a symmetric and asymmetric algorithm in the
jwt.decode
function.Here you can find an example of case where you might have a security issue with your JWT.
Exemple:
![jwt](https://user-images.githubusercontent.com/1763930/74021107-42575680-499b-11ea-9a78-97dee830a180.jpg)
Actor 1:
Actor 2:
The text was updated successfully, but these errors were encountered: