vielite's blog

QA-05: Positional Trailing Fields Can Be Misparsed in ConsensusBlockHeader

March 29, 2026
1 min read
Table of Contents
monad-qa-05-positional-trailing-fields

Summary

Optional fields such as base_fee, base_fee_trend, and base_fee_moment are decoded based on remaining payload length instead of explicit presence flags.

Vulnerability details

2025-09-monad/bft/monad-consensus-types/src/block.rs
let mut this = Self {
block_round: Decodable::decode(buf)?,
epoch: Decodable::decode(buf)?,
qc: Decodable::decode(buf)?,
author: Decodable::decode(buf)?,
seq_num: Decodable::decode(buf)?,
timestamp_ns: Decodable::decode(buf)?,
round_signature: Decodable::decode(buf)?,
delayed_execution_results: Decodable::decode(buf)?,
execution_inputs: Decodable::decode(buf)?,
block_body_id: Decodable::decode(buf)?,
base_fee: None,
base_fee_trend: None,
base_fee_moment: None,
};
if starting_len - buf.len() < rlp_header.payload_length {
this.base_fee = Some(Decodable::decode(buf)?);
}
if starting_len - buf.len() < rlp_header.payload_length {
this.base_fee_trend = Some(Decodable::decode(buf)?);
}

Impact

If field coupling changes in the future, a trailing value intended for one optional field can be misinterpreted as another during decoding.

Recommendation

Use explicit presence markers or a structure that encodes field presence unambiguously.