#38948 [BC-Low] lighthouse remote DoS

Submitted on Jan 18th 2025 at 17:45:48 UTC by @gln for Attackathon | Ethereum Protocol

  • Report ID: #38948

  • Report Type: Blockchain/DLT

  • Report severity: Low

  • Target: https://github.com/sigp/lighthouse

  • Impacts:

    • Increasing greater than or equal to 25% of network processing node resource consumption by at least 30% without brute force actions, compared to the preceding 24 hours

Description

Brief/Intro

The issue is very similar to #38920 which I've sent earlier.

Lighthouse internal rate limiter is vulnerable to integer overflow.

Remote attacker will be able to bypass rate limit checks and trigger potential Denial of Service issue.

Vulnerability Details

The BlobSidecarsByRange p2p request https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/p2p-interface.md?ref=bankless.ghost.io#blobsidecarsbyrange-v1 has two parameters - start_slot and count.

To prevent potential Denial of service issues, lighhouse has internal rate limiter.

If the 'count' value is too high, this rate limiter returns an error and request will not be processed.

Let's look at the code https://github.com/sigp/lighthouse/blob/stable/beacon_node/lighthouse_network/src/rpc/mod.rs#L396

Line #1 - rate limiter is called on this line, let's look at the actual implementation https://github.com/sigp/lighthouse/blob/stable/beacon_node/lighthouse_network/src/rpc/rate_limiter.rs

  1. The value of 'tokens' variable is equal to req.max_blob_requested() , which is equal to 'count' multiplied by 6 (max blobs per block according to spec)

  2. If 'tokens' is large enough, integer overflow will occur on this line

  3. Basically, 'additional_time' is time estimate required to process the request - if it is small, this check will not pass

As a result, rate limiter returns ok and request will be processed by lighhouse.

Impact Details

Potential Denial of service issue, as attacker could request large number of blobs from a lighthouse node.

Estimate for a space occupied by blobs is around 50gb - https://lighthouse-book.sigmaprime.io/advanced-blobs.html

https://gist.github.com/gln7/f318da428a95e72594bcc1d761c4282a

Proof of Concept

Proof of Concept

How to reproduce:

  1. get lighthouse source

  1. apply poc.patch (see gist link)

  2. run test:

  1. you should see output like this:

First run we are testing rate limit with a huge count value, rate limit signals error (too large).

Second time we are running with a count which causes integer overflow and rate limits checks are passed.

Was this helpful?