57848 sc medium permanent freezing of funds due to no minimum stake limit
Submitted on Oct 29th 2025 at 07:49:03 UTC by @KalyanSingh for Audit Comp | Belong
Report ID: #57848
Report Type: Smart Contract
Report severity: Medium
Target: https://github.com/immunefi-team/audit-comp-belong/blob/main/contracts/v2/periphery/Staking.sol
Impacts:
Permanent freezing of funds
Description
Brief / Intro
A user's stakes data is stored in:
mapping(address staker => Stake[] times) public stakes;But due to no minimum stake requirement in _deposit(), an attacker can fill up a target user's array of stakes with dust values. This can result in an OOG (out-of-gas) revert.
Vulnerability Details
When deployed on an EVM chain with a ~100M gas block limit (e.g., BSC/BNB), an attacker can perform ~40k 1-wei deposits to populate a victim's stakes array. After this, the victim may not be able to withdraw their full amount because withdrawal logic iterates sequentially over the stakes array and can hit OOG.
Assume the following scenario:
Scenario — Step 5
When Alice tries to withdraw, _consumeUnlockedSharesOrRevert parses all stake entries sequentially (see code: https://github.com/belongnet/checkin-contracts/blob/22d92a3af433a1cf4d0aa758f872c887b2f33db8/contracts/v2/periphery/Staking.sol#L258C14-L287), which can lead to OOG even with a 100M gas limit.
Estimated attacker cost to perform ~40k 1-wei deposits is approximately USD 150–200 (as provided by reporter). After this, Alice's withdrawal transactions will be hit with OOG errors, resulting in stuck funds.
Impact Details
Alice's withdrawal transactions may revert due to out-of-gas while the contract iterates over a very large stakes array — effectively freezing the victim's funds.
References
This is a classic example of DoS by array traversal.
Proof of Concept
Was this helpful?