Root cause:
The deposit() function directly assigns a new value to stakedAsset[receiver] rather than accumulating it.
Each new deposit replaces the user’s previous recorded stake instead of adding to it, breaking the expected cumulative accounting mode
Impact:
Users who deposit multiple times will lose visibility and accounting of their earlier deposits.
Refunds, cancellations, or withdrawals relying on stakedAsset will only return the most recent deposit value, effectively discarding all prior funds and creating an accounting mismatch between token balances and share supply.
Normal Behavior:
Under correct operation, each new deposit made by a user should accumulate with their previous deposits. The protocol should continuously update stakedAsset[user] to reflect the total amount of collateral the user has staked in the vault, ensuring that all future withdrawals and refunds are based on their full contribution history.
Issue:
Instead of accumulating deposits, the deposit() function overwrites the user’s previous balance in stakedAsset[receiver] each time a new deposit is made. This breaks accounting consistency, as only the most recent deposit is recorded. Earlier deposits are effectively forgotten in storage, leading to incorrect user balances and potential under-refunds during withdrawals or cancellations.
Likelihood:
Reason 1: This occurs whenever a user makes multiple deposits, since each new call to deposit() directly reassigns stakedAsset[receiver] without considering any existing balance.
Reason 2: The contract provides no accumulation logic or validation to prevent overwriting, so this mis-accounting behavior is guaranteed under normal user interaction.
Impact:
Impact 1: Users lose credit for earlier deposits, as only the latest deposit remains in storage, breaking consistency between user balances and actual token holdings.
Impact 2: Refunds, cancellations, and withdrawals return incorrect amounts, leading to potential underpayment or permanently locked funds for affected users.
Vault tracks only a single deposit slot per user and overwrites it on every call instead of accumulating the total.
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.