Boost _ Firedancer v0.1 34682 - [Blockchain_DLT - Medium] DoS in shreds validation

Submitted on Tue Aug 20 2024 20:21:43 GMT-0400 (Atlantic Standard Time) by @Swift77057 for Boost | Firedancer v0.1

Report ID: #34682

Report type: Blockchain/DLT

Report severity: Medium

Target: https://github.com/firedancer-io/firedancer/tree/e60d9a6206efaceac65a5a2c3a9e387a79d1d096

Impacts:

  • Liveness issues that cause Firedancer v0.1 validators to crash or be unavailable

Description

Brief/Intro

This is similar to report 34501, where a check in the shred tile is missing that causes the solana-labs tile to crash.

Vulnerability Details

Like in the previous report, I found another shred that causes a panic in fd_ext_blockstore_insert_shreds.

Basically, the parent_off field of a data shred is not checked by fd at all. Setting this field to a value higher than the shred's slot triggers an error here:

fn parent(&self) -> Result<Slot, Error> {
        let slot = self.common_header().slot;
        let parent_offset = self.data_header().parent_offset;
        if parent_offset == 0 && slot != 0 {
            return Err(Error::InvalidParentOffset {
                slot,
                parent_offset,
            });
        }
        slot.checked_sub(Slot::from(parent_offset))
            .ok_or(Error::InvalidParentOffset {
                slot,
                parent_offset,
            })
    }

This error then causes a panic due to the unwrap in fd_ext_blockstore_insert_shreds.

Note that this bug works, even if the flags check in previous report is fixed.

Impact Details

DoS

Proof of concept

Proof of Concept

Apply the patch and send the malicious shred.

patch2.diff:

send_shred.py

xxd shred2.bin

Last updated

Was this helpful?