fix: replace ecdsa with cryptography to mitigate Minerva timing attack#400
Open
serge-eric-kalaga wants to merge 1 commit intompdavis:masterfrom
Open
Conversation
The python-ecdsa library is vulnerable to the Minerva timing side-channel attack, which can leak nonce information during ECDSA signing and potentially lead to private key recovery. The upstream maintainers have no plans to fix it. - Make `cryptography` a required dependency (was optional) - Remove `ecdsa` from install_requires and requirements.txt - Remove ecdsa fallback in backends/__init__.py and utils.py - Fix pre-existing test bug: SECP256R1 must be instantiated (SECP256R1())
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
python-ecdsadependency withcryptography(PyCA) to eliminate exposure to the Minerva timing side-channel attackcryptographyrelies on OpenSSL which provides hardened, constant-time ECDSA implementationsSECP256R1was passed as a class instead of an instanceChanges
setup.cfg: movecryptography >=3.4.0from optional extras toinstall_requires; removeecdsarequirements.txt: replaceecdsawithcryptography >=3.4.0jose/backends/__init__.py: remove theecdsa_backendfallback forECKeyjose/utils.py: remove theecdsa.ecdsa.int_to_stringfallback forlong_to_bytestests/algorithms/test_EC.py: fixSECP256R1→SECP256R1()(API change in newercryptographyversions)Security
The
python-ecdsalibrary is vulnerable to the Minerva timing attack, which can leak nonce information during ECDSA signing and potentially allow private key recovery. The upstream maintainers consider side-channel attacks out of scope and have no plans to fix this.Testing
All existing tests pass (458 passed, 12 skipped).