HarryR / ethsnarks

A toolkit for viable zk-SNARKS on Ethereum, Web, Mobile and Desktop
GNU Lesser General Public License v3.0
241 stars 57 forks source link

Eddsa Broken Signature Verification #169

Open dxt99 opened 4 weeks ago

dxt99 commented 4 weeks ago

In ethsnarks/eddsa.py, there seems to be a missing check on the signature verification step for the param s. This param should be validated, e.g. that it is in the range 0<s<l where l is the order of the curve. Otherwise, an attacker may forge signatures from a known plaintext-signature pair by simply crafting a different s value that is still equal to the original modulo the order of the curve, for example by simply crafting s' = s + l where l is the order of the curve.