The deposit function is designed to allow one address (msg.sender) to deposit assets on behalf of another (receiver). The normal expectation is that the receiver is credited with the staked amount and is also issued the corresponding vault shares needed to withdraw their assets later.
The issue is that while the contract correctly records the staked asset amount for the receiver, it incorrectly mints the vault shares to the msg.sender. This creates a permanent desynchronization: the receiver has a stake recorded but holds no shares, while the msg.sender holds shares corresponding to an asset they did not contribute. As a result, the receiver can never withdraw their deposited funds.
Likelihood:
The function signature deposit(uint256 assets, address receiver) explicitly encourages this flawed deposit flow.
Any scenario where msg.sender is different from receiver will trigger the bug.
Impact:
Guaranteed Loss of Funds for Receiver: The intended beneficiary of the deposit (receiver) receives no shares and therefore has no mechanism to ever access or withdraw their principal investment.
Broken Contract Invariants: The fundamental accounting principle that a user's stake should correspond to their share balance is violated, rendering the contract's logic untrustworthy.
This Proof of Concept test is specifically designed to demonstrate a critical flaw in the deposit function. It simulates a realistic scenario where one user (user1) deposits funds on behalf of another (user2). The test first confirms that the contract incorrectly gives ownership shares to the sender (user1) instead of the recipient (user2). It then proves that this mistake is fatal by having the rightful owner (user2) attempt to withdraw after winning, which causes the entire contract to crash with a division-by-zero error, permanently locking all funds.
dentifies the Target: The core of the change is focused on the _mint function call within the deposit logic.
Corrects the Recipient: It changes the address receiving the newly created shares from the transaction's sender (msg.sender) to the intended beneficiary (receiver).
Restores Logic: This simple, one-line change correctly links the deposited assets to the shares, ensuring the person who is credited with the stake is also the one who can control it.
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.