-
Notifications
You must be signed in to change notification settings - Fork 43
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
ed25519 signature verification host function admits weak keys / malleable signatures #857
Comments
Thanks for opening this issue. I agree that sounds like what we should do to mitigate risks and enforce strict validation criteria. |
👍 Honest signers should produce signatures that My guess is that the most likely issue would be with something like an HSM, where the signing algorithm can't easily be changed. So it might be worthwhile to do a quick survey of hardware signing implementations---certainly worth checking YubiKeys, Ledgers, and other super common hardware. Slightly more detail on the potential issue: the edwards25519 elliptic curve has For a signature (R, S) on message M under public key A, RFC8032 defines Ed25519 verification as (essentially):
This check effectively ignores any element of the set {P0, P1, ..., P7} added to R or A. To see why:
This means I can take a signature (R, S) under public key A and produce a different-looking signature (R*, S) under public key A*, simply by adding elements of In contrast, Aside: you might ask, wait, how is this a secure signature scheme if it is possible to maul signatures? The answer is that the standard definition of digital signature security does not consider it a security break if an attacker can produce a fresh signature on a message for which it has already seen a signature. A stronger definition of security does rule this out, but many signature schemes in the past were not designed with the stronger definition in mind. This is gradually changing... |
We probably want to have the soroban host function for ed25519 signature verification call Dalek's
verify_strict
rather than justverify
, right? Currently it callsverify
but I don't think we're currently committed to that anywhere. Are we?See: https://github.com/dalek-cryptography/ed25519-dalek#weak-key-forgery-and-verify_strict
cc @C0x41lch0x41 and @MonsieurNicolas and @tomerweller for comments & constraints please!
The text was updated successfully, but these errors were encountered: