selectWinner() can be frontrun to select the preferable outcome.
Nothing prevents users from entering or refunding a raffle even if the transaction that contains selectWinner() was submitted. Indeed, that transaction is visible in the mempool by anyone and can be front-runned or even delayed by an attacker. In that case, the attacker could wait for the right RNG state to enter the raffle and call selectWinner to be selected as a winner.
Please note this is a different bug than my other submission where the RNG is not strong enough. Here the problem is due to the way a miner can re-organize transactions based on MeV. If not accounting for it correctly, an attacker can manipulate the re-ordering to get the most favorable outcome.
Attacker can force his way to be selected as a winner every time.
Manual review.
The protocol should implement a 2-steps process that are mutually exclusive:
first step allows users to enter the raffle and exit it by getting a refund (it could be based on a time period for example).
second step, only selectWinner() can be called. This insures that the winner selection process cannot be front-runned.
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.