75398 bc insight p2p block validation performs expensive operations before cheap signature check
Description
fn validate_block_internal(&mut self, envelope: &NetworkPayloadEnvelope) -> Result<(), BlockInvalidError> {
// 1. Timestamp check (cheap) ✓
// 2. Expensive block hash verification — runs before signature check
let expected = envelope.payload.block_hash();
let mut block: Block<BaseTxEnvelope> = envelope.payload.clone().try_into_block()?;
let received = block.header.hash_slow();
if received != expected { return Err(...); }
// 3. Signature check — could have run right after timestamp
let msg = envelope.payload_hash.signature_message(self.rollup_config.l2_chain_id.id());
let Ok(msg_signer) = envelope.signature.recover_address_from_prehash(&msg) else { return Err(...); };
if msg_signer != block_signer { return Err(...); }
}Impact
Recommended Patch
References
Link to Proof of Concept
Proof of Concept
Previous75410 bc high cross topic message id collision in gossipsub allows attacker to censor blocks from network nodesNext74751 sc low stale proofs in other games remain decisive and can no longer be nullified after verifier nullification
Was this helpful?