The use of weak source of randomness in the PuppyRaffle::selectWinner function leads to precomputable results.
Anyone has access to the variables used to calculate the PuppyRaffle::winnerIndex and the PuppyRaffle::rarity variables. So anyone can precompute those results and participate only if they are going to win. The exploitability of this function is increased due to the functionality of the PuppyRaffle::refund function which allows participants to be dropped from the raffle without modifying the length of the PuppyRaffle::players array.
When calculating PuppyRaffle::winnerIndex, block.timestamp is used, this variable is a bit more tricky to use to exploit the vulnerability but it is not a problem at all.
The raffle can always be manipulated
Foundry
Chainlink's oracle can be used in order to prevent this
Root cause: bad RNG Impact: manipulate winner
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.