Summary
ConsensusMessage uses derived RLP decoding, which means nested protocol payloads are decoded
before the version field is rejected.
Vulnerability details
#[derive(Clone, Debug, PartialEq, Eq, RlpEncodable, RlpDecodable)]pub struct ConsensusMessage<ST, SCT, EPT>where ST: CertificateSignatureRecoverable, SCT: SignatureCollection<NodeIdPubKey = CertificateSignaturePubKey<ST>>, EPT: ExecutionProtocol,{ pub version: u32, pub message: ProtocolMessage<ST, SCT, EPT>,}if msg_version != client_version { return Err(Error::InvalidVersion);}Impact
A peer can send oversized wrong-version messages that still trigger heavy nested decoding work
before the node returns InvalidVersion.
Recommendation
Implement a manual decoder that validates the version first and decodes the expensive payload only after that check passes.