-
Notifications
You must be signed in to change notification settings - Fork 577
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
ECDSA pubkey recovery succeeds with invalid signature #2698
Comments
Not intentional - missing a check r/s are within range of the order. Tests here are currently insufficient - we don't have any negative tests at all. |
I also found an input where S = 0 and Botan recovers a pubkey, meaning the lower bound isn't checked either. Also I think the recovery ID shouldn't be allowed to be 4: botan/src/lib/pubkey/ecdsa/ecdsa.cpp Line 39 in 8ba41c3
For reference see libsecp256k1: https://github.com/bitcoin-core/secp256k1/blob/c083cc6e52a3ab749f5451de9c515d75897649c6/src/modules/recovery/main_impl.h#L46 |
Fixed on master now - checking 0 < r,s < order and v < 4 |
In this PoC the signature S is larger than curve order. libsecp256k1 rejects this.
Is this intentionally allowed or a bug?
edit: Fixed link.
The text was updated successfully, but these errors were encountered: