User is able to DOS and grief node by repeatedly calling deposit
The SUI gateway's deposit function lacks a minimum deposit amount check, allowing users to submit zero or negligible-value deposits. An attacker could spam such deposits to overwhelm the node's event processing limit, potentially causing a denial of service for other users.
BrothersInCode Follow with g
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-04-zetachain-cross-chain-judging/issues/45
Found by
BrothersInCode, g
Summary
Description
Any user can initiate a deposit on the SUI network by calling the gateway.move::deposit function:
public entry fun deposit<T>(
gateway: &mut Gateway,
coin: Coin<T>,
receiver: String,
ctx: &mut TxContext,
) {
let amount = coin.value();
let coin_name = coin_name<T>();
check_receiver_and_deposit_to_vault(gateway, coin, receiver);
// Emit deposit event
event::emit(DepositEvent {
coin_type: coin_name,
amount: amount,
sender: tx_context::sender(ctx),
receiver: receiver,
});
}
This function in turn callscheck_receiver_and_deposit_to_vault:
// Validates receiver and deposits the coin into the vault
fun check_receiver_and_deposit_to_vault<T>(gateway: &mut Gateway, coin: Coin<T>, receiver: String) {
assert!(receiver.length() == ReceiverAddressLength, EInvalidReceiverAddress);
assert!(is_whitelisted<T>(gateway), ENotWhitelisted);
assert!(!gateway.deposit_paused, EDepositPaused);
// Perform the deposit
let coin_name = coin_name<T>();
let vault = bag::borrow_mut<String, Vault<T>>(&mut gateway.vaults, coin_name);
balance::join(&mut vault.balance, coin.into_balance());
}
This helper function performs a series of checks, including:
- Verifying the receiver address format
- Checking that the coin type is whitelisted
- Ensuring that deposits are not currently paused
However, SUI's deposit flow does not perform a minimum deposit amount/fee check.
Note that in all of the other implementations (EVM, Solana, TON) these checks are correctly performed.
Root Cause
The root cause of this issue is that there is no minimum amount/fee check enforced inside the following function
Internal Pre-conditions
None
External Pre-conditions
None
Attack Path
- Any user can call
gateway.move::depositwithcoinamount set to 0 or a neglible amount - User repeats this as many times as he wants
Impact
There are several impacts here:
- Without a minimum amount or fee requirement, users can submit empty or negligible-value deposits, which will overwhelm the node’s processing logic which in turn will drain the nodes’ funds and cause a potential DOS.
- SUI's nodes have a maximum event processing limit of 50. A malicious user could exploit this by spamming deposit transactions, quickly hitting the limit with their own events and easily causing DOS for other users
PoC
- Paste the following test-function inside
gateway_tests.move:
#[test]
fun test_deposit_zero_amount() {
let mut scenario = ts::begin(@0xA);
setup(&mut scenario);
ts::next_tx(&mut scenario, @0xA);
{
let mut gateway = scenario.take_shared<Gateway>();
let admin_cap = ts::take_from_address<AdminCap>(&scenario, @0xA);
let coin = coin::mint_for_testing<SUI>(0, scenario.ctx()); // deposit 0 amount
let eth_addr = ValidEthAddr.to_string().to_ascii();
deposit(&mut gateway, coin, eth_addr, scenario.ctx());
ts::return_to_address(@0xA, admin_cap);
ts::return_shared(gateway);
};
ts::end(scenario);
}
- run
sui move test test_deposit_zero_amount - Logs:
Running Move unit tests
[ PASS ] gateway::gateway_tests::test_deposit_zero_amount
Test result: OK. Total tests: 1; passed: 1; failed: 0
Mitigation
Ensure that users are not able to perform empty deposit calls.
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 deposit function does not enforce a minimum deposit amount or fee, unlike other chain implementations.
Impact
Spamming zero-value deposits could overwhelm the node's event processing limit and cause a denial of service for other users.
What the attacker needed
None
The fix
The deposit function should enforce a minimum deposit amount or fee to prevent empty or negligible deposits.
How it was found
- Call the deposit function with a zero or negligible coin amount.
- Repeat the deposit call many times.
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 deposit function lets users send cryptocurrency to a gateway. This report found that the function does not check if the amount is above zero, so someone can send many tiny or zero deposits. That could flood the system and stop it from working for others, like spamming a mailbox with empty letters.
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.