#41686 [BC-High] The passthrough DA light node streams transactions instead of blocks which means that the block cannot be deserialized
Description
Brief/Intro
Vulnerability Details
async fn process_block_from_da(
&mut self,
response: StreamReadFromHeightResponse,
) -> anyhow::Result<()> {
// get the block
let (block_bytes, block_timestamp, block_id, da_height) = match response
.blob
.ok_or(anyhow::anyhow!("No blob in response"))?
.blob_type
.ok_or(anyhow::anyhow!("No blob type in response"))?
{
// To allow for DA migrations we accept both sequenced and passed through blobs
blob_response::BlobType::SequencedBlobBlock(blob) => {
(blob.data, blob.timestamp, blob.blob_id, blob.height)
}
// To allow for DA migrations we accept both sequenced and passed through blobs
blob_response::BlobType::PassedThroughBlob(blob) => {
(blob.data, blob.timestamp, blob.blob_id, blob.height)
}
blob_response::BlobType::Heartbeat(_) => {
tracing::info!("Receive DA heartbeat");
// Do nothing.
return Ok(());
}
_ => anyhow::bail!("Invalid blob type"),
};
info!(
block_id = %hex::encode(block_id.clone()),
da_height = da_height,
time = block_timestamp,
"Processing block from DA"
);
// check if the block has already been executed
if self.da_db.has_executed_block(block_id.clone()).await? {
info!("Block already executed: {:#?}. It will be skipped", block_id);
return Ok(());
}
// the da height must be greater than 1
if da_height < 2 {
anyhow::bail!("Invalid DA height: {:?}", da_height);
}
>> let block: Block = bcs::from_bytes(&block_bytes[..])?;
... ...
}Impact Details
References
Proof of Concept
Proof of Concept
Previous#41678 [BC-Medium] Transactions directly sent to the passthrough will cause the mempool to accept more transactions than the `inflight_limit`Next41714 [BC-High] tampering the id of signed transactions to prevent others from executing
Was this helpful?