Skip to content

Fix: Implement strict Ed25519 consensus signature codecs to prevent runtime panics - #1024

Open
magqqgq wants to merge 1 commit into
farcasterxyz:mainfrom
magqqgq:magqqgq-patch-1
Open

Fix: Implement strict Ed25519 consensus signature codecs to prevent runtime panics#1024
magqqgq wants to merge 1 commit into
farcasterxyz:mainfrom
magqqgq:magqqgq-patch-1

Conversation

@magqqgq

@magqqgq magqqgq commented Aug 20, 2026

Copy link
Copy Markdown

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.

…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.
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

@magqqgq is attempting to deploy a commit to the Internal - Neynar Team on Vercel.

A member of the Team first needs to authorize it.

@magqqgq

magqqgq commented Aug 26, 2026

Copy link
Copy Markdown
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!

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.

1 participant