Skip to content

Minerva timing vulnerability#24

Merged
gregnazario merged 5 commits intomainfrom
cursor/minerva-timing-vulnerability-c516
Feb 23, 2026
Merged

Minerva timing vulnerability#24
gregnazario merged 5 commits intomainfrom
cursor/minerva-timing-vulnerability-c516

Conversation

@gregnazario
Copy link
Copy Markdown
Collaborator

Remove the python-ecdsa dependency and replace its usage with a compatibility layer to mitigate the Minerva timing attack vulnerability.

The python-ecdsa library is vulnerable to a Minerva timing attack on the P-256 curve, which can leak the internal nonce and potentially lead to private key discovery. Since the python-ecdsa project considers side-channel attacks out of scope, a local fix was implemented by migrating affected test steps to safer cryptographic backends (cryptography and coincurve).


Open in Web Open in Cursor 

Co-authored-by: Greg Nazario <greg@gnazar.io>
@cursor
Copy link
Copy Markdown

cursor bot commented Feb 23, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@gregnazario gregnazario requested a review from Copilot February 23, 2026 14:46
@gregnazario gregnazario marked this pull request as ready for review February 23, 2026 14:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the vulnerable python-ecdsa dependency from the Python BDD test suite and replaces the limited functionality needed by step definitions with a local compatibility layer backed by cryptography (P-256) and coincurve (secp256k1), mitigating the Minerva timing attack risk.

Changes:

  • Added tests/python/support/ecdsa_compat.py implementing a minimal SigningKey/VerifyingKey API subset used by Behave steps.
  • Updated Secp256k1 and auth-key Behave steps to use the compatibility layer and backend availability flags.
  • Replaced ecdsa in Python test requirements with cryptography and coincurve.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
tests/python/support/ecdsa_compat.py Introduces a small API shim over coincurve/cryptography to replace python-ecdsa usage in tests.
tests/python/steps/secp256k1_steps.py Switches Secp256k1 steps to import SigningKey/VerifyingKey from the compatibility layer.
tests/python/steps/auth_key_steps.py Uses the compatibility layer to generate Secp keys for auth-key-related steps and handles backend availability.
tests/python/requirements.txt Drops ecdsa and adds cryptography + coincurve dependencies for the tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Greg Nazario <greg@gnazar.io>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Greg Nazario <greg@gnazar.io>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Greg Nazario <greg@gnazar.io>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Greg Nazario <greg@gnazar.io>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +72 to +74
if not SECP256K1_AVAILABLE:
context.world.set_error(
ImportError("ecdsa library not available for Secp256k1")
ImportError("Secp256k1 crypto backend not available")
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

Error message inconsistency: secp256k1_steps.py uses "ecdsa library not available" while this file uses "Secp256k1 crypto backend not available" and "P-256 crypto backend not available". For consistency across the test suite, consider updating secp256k1_steps.py to use similar descriptive error messages, or use the same error message format in both files.

Copilot uses AI. Check for mistakes.
@gregnazario gregnazario merged commit e95db3f into main Feb 23, 2026
25 checks passed
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.

3 participants