The deposit function uses a receiver parameter that allows any user to deposit assets on behalf of another address, but mints the corresponding shares to the message sender (msg.sender). This creates a fundamental mismatch between asset ownership and share ownership, breaking the core accounting logic of the vault.
Likelihood:
The function signature with receiver parameter is inherited from ERC4626 standard but implemented incorrectly
Any user can accidentally or maliciously deposit for other addresses
The mismatch is not immediately visible but causes critical failures in downstream functions
This violates the principle of least surprise and breaks expected token accounting
Impact:
Broken accounting - stakedAsset mapping points to receiver but shares are owned by msg.sender
Failed withdrawals - withdraw() uses msg.sender to check country eligibility but the shares and asset records are mismatched
Locked funds - users may deposit for others unintentionally, locking both assets and shares
Contract state corruption - the internal accounting becomes inconsistent and unrecoverable
User1 deposits for User2,check if user2 has zero shares.
Remove the receiver parameter and enforce that deposits can only be made for the message sender:
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.