Skip to content
DoS Audit finding Intermediate

EIP-2930 transactions with 20k-address overload the nodes and force the network into "safety" mode

Shardeum accepts EIP-2930 transactions without limiting the number of addresses in the access list. An attacker can send transactions with 20,000 addresses, causing validators to create 20,000 accounts and consume excessive CPU, eventually forcing the network into safety mode and halting transaction processing.

bountyhunter2048 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#39149 [BC-High] EIP-2930 transactions with 20k-address overload the nodes and force the network into "safety" mode

Submitted on Jan 23rd 2025 at 13:20:53 UTC by @bountyhunter2048 for Audit Comp | Shardeum: Core III

  • Report ID: #39149
  • Report Type: Blockchain/DLT
  • Report severity: High
  • Target: https://github.com/shardeum/shardeum/tree/bugbounty
  • Impacts:
    • Increasing network processing node resource consumption by at least 30% without brute force actions, compared to the preceding 24 hours
    • Network not being able to confirm new transactions (total network shutdown)

Description

Brief/Intro

Shardeum allows EIP 2930 txs in the code but there is no limit check on the number of addresses in the access list. This vulnerability allows attacker to inject huge EIP2030 transaction and cause the nodes's CPU usage to goes up a lot and eventually cause the network to go to safe mode and temporarily stop processing transactions.

Vulnerability Details

Shardeum validators share accounts between them before applying the transaction in the EVM. When I attached 20k addresses in the EIP-2910 tx and send it to the network, the injected validator creates 20k accounts in the EVM and it causes lots of CPU resources. So, the tx will stuck in the queue for a long time until the emergency queue clearing mechanism kicks in because there is no way node can handle it and broadcast it to other nodes. During that period, I notice the injected validator's CPU usage goes up to 100+% (see the demo video).

Since the injected tx stuck in the queue and never get processed, it cost nothing to the attacker. He can inject the same tx to other nodes causing the same problem. After attacking the majority of the nodes, the network struggle to process new transactions because it is overwhelmed by handling 20k accounts.

The key idea behind this bug is that validator should limit the size of access list. Here is the current code causing this problem: https://github.com/shardeum/shardeum/blob/bugbounty/src/index.ts#L5593

Impact Details

Nodes' CPU usages goes up 100+% and do not go down. Nodes becomes so occupied that they cannot process new transactions. After some time, nodes will crash due to hardware limit or being unresponsive and removed from the network. The network will go into "Safety" mode and stop processing transactions including staking and unstaking. Please see the demo: https://youtu.be/QIF4-14jZgU

References

https://gist.github.com/bountyhunter2048/b6c403717033737c36ff26cbceaa8dd2

Link to Proof of Concept

https://gist.github.com/bountyhunter2048/b6c403717033737c36ff26cbceaa8dd2

Proof of Concept

Proof of Concept

The concept to prove it is very simple. Attacker just need to create a few huge EIP-2930 txs and inject them to different nodes. The attack will be more dangerous if attacker do it from multiple machines in a short time. Here are the detail step and use the script provided in github gist.

  • Start a network and add your address in genesis file so that you have funds to do the test
  • Use this script in hardhat project. Put your private key in .env file
  • Run the script. You can adjust number of wallets to use and number of transactions to inject
  • The script will create EIP txs with access list having 20k addresses and inject those txs at 1 TPS
  • The node that receives the transaction will use a lot of CPU resources to process it.
  • The script will do this to each of the nodes in the network
    In real world, attacker can use multiple machines to inject tx to different nodes in a short span of time
  • The injected txs are not applied because nodes will never be able to handle 20k accounts in a transaction, making this attack basically free of charge.
    After some time, due to continuous CPU load some nodes will crash and network will go into safe mode

Demo video: https://youtu.be/QIF4-14jZgU

Gist: https://gist.github.com/bountyhunter2048/b6c403717033737c36ff26cbceaa8dd2

The original report as published on Immunefi, by bountyhunter2048. 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 code does not enforce a maximum size for the access list in EIP-2930 transactions, allowing an attacker to include an arbitrarily large number of addresses.

Impact

Nodes' CPU usage goes up 100+% and do not go down, making them unable to process new transactions; after some time nodes may crash or become unresponsive and be removed from the network, causing the network to enter safety mode and stop processing transactions including staking and unstaking.

What the attacker needed

Attacker has funds to send transactions; attacker can send transactions to multiple nodes; network accepts EIP-2930 transactions

The fix

The validator should limit the size of the access list in EIP-2930 transactions.

How it was found

  1. Start a network and add your address in genesis file so that you have funds to do the test
  2. Use this script in hardhat project. Put your private key in .env file
  3. Run the script. You can adjust number of wallets to use and number of transactions to inject
  4. The script will create EIP txs with access list having 20k addresses and inject those txs at 1 TPS
  5. The node that receives the transaction will use a lot of CPU resources to process it.
  6. The script will do this to each of the nodes 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.

EIP-2930 transactions let you list addresses that the transaction will interact with, so the system can prepare them in advance. Shardeum does not limit how many addresses can be listed, so an attacker can list 20,000 addresses. Each address forces the node to create an account, which uses a lot of processing power and can make the node unresponsive.

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 bountyhunter2048

View all

3 more disclosed reports, best first.

More from Shardeum: Core III

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.