-
Notifications
You must be signed in to change notification settings - Fork 46
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
Crash when signature with invalid JWK is attempted #82
Comments
Thanks @samugi , seems to be an bug on openssl, there's no guard before calling sign https://github.com/openssl/openssl/blob/OpenSSL_1_1_1r/crypto/ec/curve25519.c#L5442 note in stacktrace
let me submit an issue at upstream. for now i'm going to do a pre-check on if pkey is private key before sign. |
It's now fixed in 0.8.15 release. I will keep this issue open for a bit for tracking. |
closing this now as it's fixed in upstream. openssl team decided to not backport this to 1.1.1 as it's not a security issue, so our own check to verify it's a private key should stay. |
If an invalid JWK that is missing the private exponent
p
is passed topkey.new()
for theOKP
type, the subsequent call topkey:sign()
will result in a crash and kill the worker.Can be reproduced with:
Using the following JWK instead works as expected:
{"kty" : "OKP", "crv" : "Ed25519","x" : "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4", "d" : "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM"}
.The text was updated successfully, but these errors were encountered: