Skip to content
DoS Audit finding Intermediate

Potential DoS of archiver-server during network restoration via get_account_data_archiver call

The archiver server's get_account_data_archiver API call lacks a limit on the number of accounts a validator can request during network restoration. An attacker with an active validator could request all accounts in a single small request, overloading the archiver and causing a denial of service that prevents other validators from syncing.

periniondon630 Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

#35709 [W&A-Critical] Potential DoS of archiver-server during network restoration via get_account_da

Submitted on Oct 4th 2024 at 08:45:54 UTC by @periniondon630 for Audit Comp | Shardeum: Ancillaries II

Description

Brief/Intro

There is no limit on the number of accounts that a validator can request from the archiver during network restoration, which can lead to a DoS attack on the archiver server.

Vulnerability Details

The get_account_data_archiver API call is used by validators during the network restoration phase to sync new validators from archivers. However, there is no limit set on the number of accounts (the maxRecords parameter) that can be requested. If the network contains billions of accounts, an attacker with an active validator could request all of them in a single small request. This would overload the archiver, which would need to fetch the data from the database, serialize the result, and send it back to the validator, leading to potential performance issues or a DoS attack. This could cause serious problems during network restoration, as other new validators would be unable to sync with the network and start processing transactions.

Impact Details

The archiver server is vulnerable to a potential DoS attack during network restoration, which could cripple the network’s ability to process transactions, effectively paralyzing its operations.

References

https://github.com/shardeum/archive-server/blob/0337daa477b3a30f8fb65b87c23b021a261441bd/src/API.ts#L927

Link to Proof of Concept

https://gist.github.com/periniondon630/e0bb113b033710c9e9ef677c8a0082b0

Proof of Concept

  1. Apply the `'bugbounty'` API call patch from the documentation to the attacker's validator and wait for it to become active.
  2. Put the network into the restoration phase.
  3. Run `poc.js` from the gist using the following command: ```bash node poc.js ATTACKER_ID:ATTACKER_PORT ``` To simplify the test, you can remove the currentNetworkMode !== 'restore' condition in the validateAccountDataRequest function. Additionally, you need to create a large number of accounts to simulate a real network—this can be done using a modified poc.js script from the documentation.

The original report as published on Immunefi, by periniondon630. 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 API endpoint does not enforce a maximum value for the maxRecords parameter, allowing arbitrarily large data requests.

Impact

The archiver server could be overwhelmed, preventing other validators from syncing and potentially paralyzing the network's ability to process transactions.

What the attacker needed

An active validator; network in restoration phase

How it was found

  1. Apply the 'bugbounty' API call patch to the attacker's validator and wait for it to become active.
  2. Put the network into the restoration phase.
  3. Run poc.js from the gist using the command node poc.js ATTACKER_ID:ATTACKER_PORT.
  4. Optionally remove the currentNetworkMode !== 'restore' condition in validateAccountDataRequest to simplify testing.
  5. Create a large number of accounts to simulate a real network using a modified poc.js script.

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 denial-of-service (DoS) attack makes a service unavailable by overwhelming it with work. Here, a validator (a node that helps run the network) can ask the archiver (a server that stores account data) for an unlimited number of accounts at once. If an attacker asks for billions of accounts, the archiver gets overloaded and cannot respond to other validators, which stops the network from recovering.

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 periniondon630

View all

11 more disclosed reports, best first.

More from Shardeum: Ancillaries II

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.