Repository navigation
π‘οΈ Sentinel: [HIGH] Fix Ed25519 signature malleability #7
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
Closed
euxaristia
wants to merge
1
commit into
main
from
sentinel/fix-ed25519-signature-malleability-5142938352462540804
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ## 2024-08-11 - Use `verify_strict` for Ed25519 signature verification | ||
| **Vulnerability:** Signature malleability in Ed25519 signatures due to `verify` instead of `verify_strict`. | ||
| **Learning:** `ed25519-dalek` provides a standard `verify` method that doesn't strictly adhere to RFC 8032 requirements for non-malleability, leading to multiple valid signatures for the same message. | ||
| **Prevention:** Use `verify_strict` when verifying Ed25519 signatures using `ed25519-dalek` to ensure RFC 8032 compliance. | ||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π Security & Privacy | π‘ Minor | β‘ Quick win
π§© Analysis chain
π Script executed:
Repository: euxaristia/node
Length of output: 5598
π Web query:
ed25519-dalek verify_strict documentation RFC 8032 ZIP-215 non-RFC 8032 compliantπ‘ Result:
In the ed25519-dalek library, the
verify_strictmethod is a specialized verification function designed to mitigate specific vulnerabilities, such as weak-key forgery [1][2][3]. It is explicitly documented as being "technically non-RFC 8032 compliant" because it enforces additional checks not mandated by the RFC [4][3]. The primary reasons for this non-compliance and the divergence from RFC 8032 are as follows: RFC 8032 Compliance: RFC 8032 mandates that signature verification must fail if the scalarsis not properly reduced modulo the group orderL[4][3]. Whileed25519-dalek's verification functions (includingverify_strict) perform this check, the RFC also specifies optional malleability checks [4][3]. Strict Verification vs. RFC 8032: Theverify_strictmethod performs extra checksβspecifically, it verifies that neither the public keyAnor the signature pointRare small-order (weak) points [3][5]. These checks are not strictly required by the base RFC 8032 specification but are necessary to prevent "weak-key forgery" attacks, where an attacker crafts a signature that is valid for almost any message [1][2][5]. Relationship to ZIP-215: ZIP-215 was introduced to resolve ambiguities and consensus-critical differences in how various Ed25519 implementations interpret RFC 8032 [6][7]. ZIP-215 mandates the use of a "cofactor-multiplied" verification equation ([8][S]B = [8]R + [8][k]A), whereas RFC 8032 allows an unmultiplied version ([S]B = R + [k]A) [9][6]. Current State in ed25519-dalek: As of the latest documentation, theverify_strictimplementation ined25519-dalekdoes not fully conform to the ZIP-215 validation criteria [4][3]. Specifically, it historically used the unmultiplied verification equation (without the cofactor) and performed different point encoding checks than those defined in ZIP-215 [9][8]. While there have been ongoing discussions and efforts to implement ZIP-215-compliant verification within the broadercurve25519-dalekecosystem,verify_strictis primarily intended for its original purpose of weak-key resistance rather than serving as a ZIP-215 implementation [9][3][8]. In summary,verify_strictis non-compliant with RFC 8032 because it adds defensive checks against weak-key forgery that the RFC does not enforce, and it currently does not align with the specific cofactor-multiplied verification rules required by ZIP-215 [4][9][3].Citations:
verify_strictand weak-key forgeryΒ dalek-cryptography/ed25519-dalek#259Describe
verify_strictas stricter than RFC 8032.ed25519-dalekdocumentsverify_strictas technically non-RFC 8032 compliant because it applies additional validation. Update.jules/sentinel.mdand both Sentinel comments to describe the repositoryβs intentional stricter policy for rejecting malleable and weak-key encodings. Keepverify_strict.π Affects 3 files
.jules/sentinel.md#L1-L4(this comment)crates/gitlawb-attest/src/attestation.rs#L114-L115crates/gitlawb-core/src/identity.rs#L82-L84π€ Prompt for AI Agents
Source: MCP tools