Skip to content
DoS Audit finding Advanced

Complete shutdown of the transaction processing

The handler for an internal message did not limit the number of account IDs it processed, and it held a lock also used by transaction processing. An attacker could send a large list of random accounts to slow or stop transaction processing on a node or across the network.

doxtopzhivago Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

33655 - [BC - Critical] Complete shutdown of the transaction processing...

Submitted on Jul 25th 2024 at 22:31:08 UTC by @doxtopzhivago for Boost | Shardeum: Core

Report ID: #33655

Report type: Blockchain/DLT

Report severity: Critical

Target: https://github.com/shardeum/shardus-core/tree/dev

Impacts:

  • Network not being able to confirm new transactions (total network shutdown)

Description

Brief/Intro

The handler of the internal message 'binary/get_account_data_with_queue_hints' can cause transaction processing queue blocking because of the sharing the same locking mechanism.

Vulnerability Details

The handler of the internal message 'binary/get_account_data_with_queue_hints' is not setting correct bounds for length of the accounts list (Actually it is 2^32). For each account the handler is executing app.getAccountDataByList which is calling AccountStorage.getAccount -> getAccountEntry -> creates and runs SQL query for each account ID. Also the handler is creating fifoLock('accountModification') which is used in the following functions: preApplyTransaction and commitConsensedTransaction. Which are two critical functions for transaction processing. If this fifoLock is occupied by this handler, transaction processing will be slowed down or even stopped. So by sending a big list (2^32) of random accounts it can create a significant delay in transaction processing on the single node.

It also can be scaled so that whole network performance will fall down:

For incomming messages there is no check that remote IP address belongs to the node, only verification by signature. So private key from single standby node can be used by multiple senders.

In case of mass sending from multiple senders to all validators (list is open) attacker can completely stop transaction processing or significantly slow it down because the fifoLock is shared between transaction processing flow and the handler.

In my experiment it was causing onProcesssingQueueStuck and node became offline.

Impact Details

I want to emphasize that it is not just a simple DOS, it is overloading bottleneck (fifoLock) which is also used in some critical functions in a system. By increasing number of accounts in a message you can impact transaction processing on target nodes or the whole network itself.

References

https://github.com/shardeum/shardus-core/blob/4d75f797a9d67af7a94dec8860220c4e0f9ade3c/src/state-manager/index.ts#L2015

Proof of Concept

Please apply the following gist to Shardeum repository. In order to activate this attack call the http GET /attack method on any active validator in the network.

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

Likely the handler lacked a limit on the number of account IDs it would process and shared a lock with critical transaction functions, allowing a single request to monopolise the lock.

Impact

An attacker could cause a significant delay in transaction processing on a single node, and by scaling the attack could completely stop or significantly slow transaction processing across the whole network.

What the attacker needed

Private key from a standby node; ability to send internal messages to validators; knowledge of validator IP addresses

How it was found

  1. Apply the provided proof-of-concept code to the Shardeum repository.
  2. Call the HTTP GET /attack method on any active validator in the network.

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 lock is a mechanism that stops two parts of a program from using the same resource at once. Here, a message handler took a lock that transaction processing also needs, and it could be made to hold that lock for a very long time by sending a huge list of account IDs. This meant normal transactions could not proceed, effectively freezing the node.

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 doxtopzhivago

View all

3 more disclosed reports, best first.

More from Shardeum: Core

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.