Skip to content
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

Apply nonce bit-length mitigation to stop timing leakage. #203

Closed
wants to merge 2 commits into from

Conversation

J08nY
Copy link

@J08nY J08nY commented Oct 5, 2019

This should be a mitigation for the Minerva attack. See https://minerva.crocs.fi.muni.cz for more info. Some tests would be nice to see this is really constant time (and wasn't before), but I am not that well versed in JavaScript.

@coveralls
Copy link

coveralls commented Oct 5, 2019

Coverage Status

Coverage increased (+0.03%) to 89.152% when pulling c36942b on J08nY:fix/minerva into 71e4e8e on indutny:master.

@J08nY
Copy link
Author

J08nY commented Oct 17, 2019

Hi @indutny, is there any movement on this? This project is used by many others and remains likely vulnerable and not fixed months after our disclosure.

@Rob-pw
Copy link

Rob-pw commented Oct 18, 2019

Thanks for the PR, just wandering by (edit: bump & witness)

Copy link
Owner

@indutny indutny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for submitting this and sorry for delay. There are few minor changes that I'd like to request before landing it, though!

lib/elliptic/ec/index.js Outdated Show resolved Hide resolved
lib/elliptic/ec/index.js Outdated Show resolved Hide resolved
lib/elliptic/ec/index.js Show resolved Hide resolved
Co-Authored-By: Fedor Indutny <fedor.indutny@gmail.com>
@J08nY
Copy link
Author

J08nY commented Oct 21, 2019

LGTM. Thank you for submitting this and sorry for delay. There are few minor changes that I'd like to request before landing it, though!

Fixed those. Please test the changes (and timing).

ssmyczynski added a commit to simplito/elliptic-php that referenced this pull request Nov 14, 2019
@indutny
Copy link
Owner

indutny commented Nov 22, 2019

Hey, I've went ahead and applied alternative "fix": ec735ed . However, as bad as it sounds it must be said that this library was never meant to be timing-leak free. Architecture of elliptic and bn.js was designed to provide the fastest possible pure JS implementation of elliptic curve so that it would be usable in browsers. Patching this one particular loophole doesn't mean that there are no other side-channels (in fact, there are many through the source code).

@indutny indutny closed this Nov 22, 2019
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

Successfully merging this pull request may close these issues.

4 participants