Malicious light node can dos the full node
The full node's block streaming function lacks a limit on the number of blocks it will process from a light node. A malicious light node can stream an excessive or infinite number of blocks, causing the full node to loop indefinitely and become unavailable.
- Disclosed after under an hour
#43054 [BC-High] malicious light node can dos the full node
#43054 [BC-High] Malicious Light Node can DoS the Full Node
Submitted on Apr 1st 2025 at 08:23:50 UTC by @Blockian for Attackathon | Movement Labs
- Report ID: #43054
- Report Type: Blockchain/DLT
- Report severity: High
- Target: https://github.com/immunefi-team/attackathon-movement/tree/main/networks/movement/movement-full-node
- Impacts:
- Network not being able to confirm new transactions (total network shutdown)
Description
Movement Bug Report
Malicious Light Node can DoS the Full Node
Summary
The StreamBlocks::execute() function in src/da/stream_blocks/mod.rs initiates a block stream from a light node using stream_read_from_height. However, it does not impose any limit on how many blocks can be returned or processed. A malicious or faulty light node can exploit this to flood the client with blocks, causing a Denial of Service (DoS).
Root Cause Analysis
Examining the StreamBlocks::execute() function:
pub async fn execute(&self) -> Result<(), anyhow::Error> {
// ... not relevant for this issue
let mut blocks_from_da = client
.stream_read_from_height(StreamReadFromHeightRequest { height: self.from_height })
.await
.context("Failed to stream blocks from DA")?;
// ... not relevant for this issue
while let Some(block_res) = blocks_from_da.next().await {
// ... not relevant for this issue
}
}
When processing the blocks received from the light node client, there is no stop mechanism besides blocks_from_da.next() being empty.
Thus, a malicious light node can send a huge amount of data, for example a huge amount of blob_response::BlobType::Heartbeat and cause the loop to run indefinitely.
Impact
- A malicious light node can continuously stream an excessive or infinite number of blocks.
- The node processing this stream can get stuck in the loop indefinitely.
- This can compromise the availability and liveness of the chain.
Proposed Fixes
- Add an upper bound for the number of blocks to stream (e.g.,
max_blocks). - Break the loop if a certain block height is reached or if the block stream exceeds a safe limit.
Proof of Concept
Proof of Concept (PoC)
- Connect the client to a light node controlled by you.
- When
stream_read_from_heightis requested from the light node, respond with a huge number of blocks or continuously stream blocks without bound. - Observe that the loop taking a huge time to finish or never exits and system resource usage increases over time.
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
Root cause
The block streaming loop has no upper bound on the number of blocks processed, so it only stops when the stream ends.
Impact
A malicious light node could cause the full node to loop indefinitely, compromising the availability and liveness of the chain.
What the attacker needed
Control of a light node; full node connects to that light node
The fix
The code should be fixed by adding an upper bound on the number of blocks to stream and breaking the loop when a safe limit or block height is reached.
How it was found
- Connect the client to a light node controlled by you.
- When stream_read_from_height is requested, respond with a huge number of blocks or continuously stream blocks without bound.
- Observe that the loop takes a huge time to finish or never exits and system resource usage increases over time.
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.
A full node is a computer that keeps the whole blockchain and talks to other nodes. Here, it asks a 'light node' for a list of blocks, but it never says 'stop after this many'. A bad light node can keep sending blocks forever, so the full node gets stuck and can't do its job.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.