-
Notifications
You must be signed in to change notification settings - Fork 240
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
JWS verification succeeds with both public and private keys when signing with the private key using RS256 #53
Comments
This happens because the private key contains both the public and private key info. The Note that this will not work the other way around, which would be a huge security flaw. You can not construct a token with a public key that would pass verification with the same public key. |
I will need to look into what the correct behavior should be here, I'm a little wary to start throwing an error in this case since the key being used contains the information to successfully verify the signature. |
Could just log a warning... |
In JWT.IO's online debugger, signature verification succeeds only with the public key. |
@dumptyd Are you 100% positive that signature verification succeeds only with the public key when the selected algorithm is an RS algorithm? Because signature verification with one of the HS algorithm options selected (even though the supplied secret symmetric key is an asymmetric public key) is totally expected and perfectly fine. |
Here's the code snippet.
(PS: Not my keys)
The text was updated successfully, but these errors were encountered: