Players can deposit on behalf of others but keep all shares to themselves since shares are minted to msg.sender in deposit process, instead of receiver.
Hence when winner is set and victims want to withdraw their prize, they will get zero payout since they don't have any shares under their address.
This BriVault::deposit does not conform to ERC-4626 semantics (mint to receiver, notmsg.sender).
Likelihood:
No permissions needed. Attacker just calls deposit(x, victim) and keeps the shares. The only cost is gas and participation fee.
Impact:
Potential griefing risk: An attacker can “sponsor” deposits for many victims, and make those victims think they’re in—yet they hold no shares, so even if their country wins they withdraw nothing.
Attackers don't directly steal from victim's wallet or the vault, but misled victims may lose expected payout.
The test function below shows the attack flow for delegated deposit. Player2 is misled by malicious player1 to think they already has the shares. Player2 can withdraw nothing after winner is set, even though they are a legit winner.
How to run this test: Paste test function test_exploitCanDepositOnBehalfOfOthers in file test/briVault.t.sol.
Change the minting logic to make it conform with ERC-4626 semantics (mint to receiver, notmsg.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.