The WithdrawalPool::_finalizeWithdrawals function in the contract handles withdrawal accounting but suffers from inconsistent unit handling. It mixes Wei (Ether), LST, and shares without properly converting between them. This issue could lead to serious miscalculations during withdrawal processing, where users could receive incorrect amounts or incorrect value transfers, ultimately breaking the functionality of the withdrawal system.
The vulnerability arises due to the inconsistent use of different token units throughout the WithdrawalPool::_finalizeWithdrawals function. Specifically:
Wei (Ether) is used in the input amount (_amount).
Shares are used internally to represent staking amounts.
LST are used to represent stLINK's .
Expectec unit in _getStakeByShares function parameter _amount is shares but it is given 1 ether which causes mismatch of units. The _getStakeByShares function is invoked using 1 ether (Wei).
This inconsistency can result in users receiving the wrong amount of LST tokens, leading to potential financial losses or operational issues with the contract.
Potential Financial Losses: Users could lose a significant amount of funds if the miscalculation results in lower-than-expected withdrawals. Conversely, the protocol could lose assets if it over-distributes tokens, leading to potential insolvency or liquidity issues.
Protocol Disruption: The staking and withdrawal system may be thrown off balance if this vulnerability is exploited. Incorrect accounting could lead to discrepancies in the total assets under management (AUM), making it difficult or impossible to process withdrawals correctly, which might eventually lock users out of their funds.
Reputation Damage: The financial and operational consequences of this issue could lead to a loss of trust in the protocol, reducing user confidence and harming the protocol's reputation in the market.
This vulnerability could lead to the contract being unusable if the system cannot process withdrawals correctly due to miscalculations based on unit mismatches.
Manual code review and analysis of the unit handling within the function, focusing on conversion between different token units (Wei, LST, and shares).
Inuser that the given amount is always shares.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.