Skip to content
Audit finding Beginner

Flawed documentation when streaming da blobs leads to confusion

The report points out that a code comment in the stream_da_blobs_from_height function incorrectly states that certificates with height less than last_height are ignored, when in fact certificates with height equal to last_height are also ignored. This documentation error could confuse developers but does not directly enable an attacker to do anything harmful.

okmxuse Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#43186 [BC-Insight] Flawed documentation when streaming da blobs leads to confusion

Submitted on Apr 3rd 2025 at 13:11:23 UTC by @okmxuse for Attackathon | Movement Labs

Description

Description

Inside stream_da_blobs_from_height, the certificate_stream is obtained with the following call:

JavaScript
let certificate_stream = self.stream_certificates().await?;

The stream is then iterated to retrieve individual certificate values:

JavaScript
while let Some(certificate) = certificate_stream.next().await {

If a retrieved certificate returns Ok and height > last_height, the function proceeds to invoke stream_da_blobs_between_heights:

JavaScript
Ok(Certificate::Height(height)) if height > last_height => {
    let blob_stream = self
        .stream_da_blobs_between_heights(last_height, height)
        .await?;
    tokio::pin!(blob_stream);

    while let Some(blob) = blob_stream.next().await {
        yield blob?;
    }

    last_height = height;
}

However, if height <= last_height, a warning message is logged instead:

JavaScript
_ => {
    warn!("ignoring certificate");
}

It is important to note that the comment preceding this warning states:

JavaScript
// If height is less than last height, ignore

This comment is incorrect because the warning is triggered not only when height < last_height but also when height == last_height.

Impact

this fits the in-scope Documentation Improvements as the comment made here is incorrect.

Recommendation

Diff
- // If height is less than last height, ignore
+ // If height is less than or equal to last height, ignore

Proof of Concept

POC

  • A user or developer examining the codebase encounters the following if statement:

    JavaScript
    Ok(Certificate::Height(height)) if height > last_height => {
        let blob_stream = self
            .stream_da_blobs_between_heights(last_height, height)
            .await?;
        tokio::pin!(blob_stream);
    
        while let Some(blob) = blob_stream.next().await {
            yield blob?;
        }
    
        last_height = height;
    }
    
  • Based on this logic, they reasonably assume that when the condition is not met, it means height is <= last_height.

  • However, the documentation contains an incorrect comment that misleadingly states:

    JavaScript
    // If height is less than last height, ignore
    

    This is inaccurate because the warning is also triggered when height == last_height, not just when height < last_height.

The original report as published on Immunefi, by okmxuse. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

The incorrect comment could mislead developers, but there is no direct security impact described.

What the attacker needed

None

The fix

The comment should be updated to say 'less than or equal to last height' instead of 'less than last height'.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This is about a misleading comment in computer code. The comment says one thing, but the code actually does something slightly different, which could confuse someone reading it. No security vulnerability is exploited here; it's just a documentation mistake.

More by okmxuse

View all

9 more disclosed reports, best first.

More from Movement Labs

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.