-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
crypto/elliptic: invalid handling for infinity point #37294
Comments
cc @FiloSottile |
By the way, should I have considered this a security bug and followed the guidelines from https://golang.org/security ? |
Thank you for raising this. I spent some time thinking about this while implementing In abelian coordinates (x, y) there is no valid representation of the infinity point. (0, 0) is not a valid point on the curve, it's just adopted by convention in many APIs. An API can just as well decide not to represent it at all, if it's not required for its use cases. If we accept that (0, 0) is not a valid point in our API, The unfortunate part is that the arithmetic functions can return an invalid representation if fed specific inputs. That's definitely bad. It would be dangerous to change the API to support (0, 0) now, because there might be applications that rely on Not a fan of either. @agl any opinions? (@catenacyber it's always ok to be conservative and email security@, I think this one is ok to discuss publicly.) |
Ok, I will be conservative next time (I had not noticed this security email the first time) So, I understand the problem about backward compatibility. |
Change https://golang.org/cl/239562 mentions this issue: |
What did you do?
I have been doing differential fuzzing on elliptic curve cryptography.
I am adding golang
crypto/elliptic
to my fuzzer : https://github.com/catenacyber/elliptic-curve-differential-fuzzerAnd I found one inconsistency.
The infinity point is not encoded with a single 0 byte as it could be. But I did not find a standard for this encoding used by other libraries.
Worse : the infinity point is not considered to be on the curve... Any scalar multiplication of a point on the curve must be on the curve.
Reproducer code is here :
https://play.golang.org/p/kvjqBssEGTv
What did you expect to see?
The reproducer code should output
What did you see instead?
Does this issue reproduce with the latest release (go1.13.8)?
Yes with
go version go1.13.8 linux/amd64
System details
The text was updated successfully, but these errors were encountered: