The cancelParticipation function has a critical vulnerablility where a first depositor can burn shares with a zero refund amount, this effectively inflates the conversion rate that the next depositors will deposit but mint zero shares hence donating the deposit amount to the vault balance. As more users deposit, the conversion rate is further inflated to the extent that even large deposits mint zero shares.
The attacker can exploit this vulnerability by:
First user deposits
Sends shares received minus 1 wei to another address they control
Joins event
Cancel the participation from the other wallet
Now donates to vault to inflate conversion rate further
Victims deposit after price has been inflated, more deposits that mint zero shares further inflate conversion rate
up to a point where even whale deposits receive zero shares
At this point, the deposit balance is huge and backed by 1 share which belongs to the attacker
Attacker takes all the winnings, netting massive profits.
Likelihood:
This happens when a user transfers shares received minus 1 wei to another address they control and then cancel perticipation.
Impact:
High
Attacker drains the vault of all the assets.
Other users even when they win, mint zero shares and can not withdraw anything.
Add this test to briVault.t.sol and run forge test --mt testBypassBurnShares -vvvv
In the cancelParticipation function, ensure the number of shares to burn corresponds to the amount of assets being refunded.
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.