Fix: Implement strict Ed25519 consensus signature codecs to prevent runtime panics - #1024
Open
magqqgq wants to merge 1 commit into
Open
Fix: Implement strict Ed25519 consensus signature codecs to prevent runtime panics#1024magqqgq wants to merge 1 commit into
magqqgq wants to merge 1 commit into
Conversation
…untime panics ### Description This PR addresses a critical consensus runtime safety vulnerability within the `snapchain` repository. **Vulnerabilities & Security Defects Remediated:** * **Consensus Runtime Safety (`snapchain/src/core/types.rs`):** The Ed25519 `decode_signature` and `encode_signature` trait methods were previously unimplemented placeholders, which would cause the node to panic at runtime. * **Strict Codec Validation:** These methods have been implemented with strict validation rules that reject any signature not measuring exactly 64 bytes, preventing dynamic retry behavior or unbounded parsing. Valid signatures are now losslessly encoded and decoded. * **Regression Testing:** Added explicit unit tests (`signature_codec_round_trips_ed25519_bytes` and `signature_codec_rejects_invalid_lengths`) to cover valid round-trips and invalid length edge cases.
|
@magqqgq is attempting to deploy a commit to the Internal - Neynar Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Hi team, the PR is ready for review. Could a maintainer please click 'authorize it' on the Vercel bot's comment so the preview builds can run? Thanks! |
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.
Description
This PR addresses a critical consensus runtime safety vulnerability within the
snapchainrepository.Vulnerabilities & Security Defects Remediated:
snapchain/src/core/types.rs): The Ed25519decode_signatureandencode_signaturetrait methods were previously unimplemented placeholders, which would cause the node to panic at runtime.signature_codec_round_trips_ed25519_bytesandsignature_codec_rejects_invalid_lengths) to cover valid round-trips and invalid length edge cases.