Skip to content

Insecure signature verification algorithm for ed25519 #426

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

Closed
calctopian opened this issue Jul 20, 2020 · 6 comments
Closed

Insecure signature verification algorithm for ed25519 #426

calctopian opened this issue Jul 20, 2020 · 6 comments

Comments

@calctopian
Copy link
Contributor

calctopian commented Jul 20, 2020

As currently implemented, the verification algorithm is not strongly unforgeable under chosen message attacks (SUF-CMA), that is, an adversary can construct an alternative signature for a given signed message; moreover, it doesn't provide guarantees of malicious strong universal exclusive ownership (M-S-UEO) to prevent key substition attacks. Furthermore, it doesn't guarantee Message-Bound Signatures (MBS), i.e., there exist no two distinct messages for which the same signature would verify with respect to a given (potentially maliciously generated) public key.

Warning: failing to patch this vulnerability could lead to double-spending attacks on cothority.

Fixed by pull request #427
Supersede issue #311

@ineiti
Copy link
Member

ineiti commented Jul 21, 2020

Thanks for the warning for double-spending attacks ;) I'd have to look into our verifications to make sure this is not possible.

@calctopian
Copy link
Contributor Author

About the exploitability of this issue:

If a malicious attacker adds one of points of the subgroups of small order (i.e., non-identity torsion points) to a key image, up to 7 double spends could be performed for each authentic spend on the cothority: this is now prevented by the Ge25519HasSmallOrder function.

This happens because multiplying the sum of a torsion point by a multiple of 8 and a "normal" point will return the same point, because multiplying small subgroup points by 8 returns the identity element. Without the function Ge25519HasSmallOrder, signatures verify on malicious key images derived from the authentic ones.

@ineiti
Copy link
Member

ineiti commented Jul 21, 2020

Just for naming: cothority is the big project that includes a lot of smaller projects. The biggest of the smaller projects is byzcoin, which implements a blockchain using a BFT algorithm. So the attack would be against byzcoin.

I wonder how feasible such an attack would be, given that each transaction that is signed also has a nonce in it. So it is not possible to 'double spend' or 'replay' a transaction - you would need to be able to increase the nonce and still have a valid signature, which, if I understand the attack correctly, is not possible.

Also, can you please elaborate what you call a key image?

@calctopian
Copy link
Contributor Author

Byzcoin using nonces is great because nonces provide extra protection: additionally, Byzcoin is using blscosi and not EdDSA as was previously used with cosi: thus transactions seem to remain safe from this attack.

But Darcs are broken, because their identities are using ed25519: although instead of using EdDSA, Darcs are using a compatible Schnorr signature scheme, also implemented in Kyber.

And Darcs are used everywhere, or even Schnorr (e.g., viewchanges, roster extension, authproxy, evoting, ...)

@ineiti
Copy link
Member

ineiti commented Jul 24, 2020

As always, there is an issue for that: dedis/cothority#2186

@calctopian
Copy link
Contributor Author

It's not the same thing: issue dedis/cothority#2186 is suggesting the introduction of a new darc-identity that uses EdDSA.

What I'm talking here is about fixing schnorr.Verify too, much like eddsa.Verify was being fixed by PR #427.

Fortunately, my latest commit also fixes schnorr.Verify: the awesome cothority is a bit more secure now :)

@gnarula gnarula closed this as completed in 88245de Aug 6, 2020
janbormet pushed a commit to janbormet/kyber that referenced this issue Aug 22, 2023
Added `edda.VerifyWithChecks` which checks if the scalars and
points are canonical and ensures the points do not have a small
order.

Refer: RFC8032§5.1.7 and https://eprint.iacr.org/2020/823.pdf

Builds on top of dedis#427 and closes dedis#426 and dedis#311.

Co-authored-by: David Cerezo <david@calctopia.com>
Co-authored-by: Linus Gasser <linus.gasser@epfl.ch>
K1li4nL pushed a commit that referenced this issue May 16, 2024
Added `edda.VerifyWithChecks` which checks if the scalars and
points are canonical and ensures the points do not have a small
order.

Refer: RFC8032§5.1.7 and https://eprint.iacr.org/2020/823.pdf

Builds on top of #427 and closes #426 and #311.

Co-authored-by: David Cerezo <david@calctopia.com>
Co-authored-by: Linus Gasser <linus.gasser@epfl.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants