selectWinner() depends on known / predictable inputs.
The function depends on msg.sender, block.timestamp and block.difficulty. That allows to predict a result of winnerIndex quite easily.
Sample test to reproduce the vulnerability:
Need to add the following methods to PuppyRaffle.sol:
Although the comment on line 138 and code on line 139:
state that a different random function is used, rarity generation still has the same predictability problem, because the parameters for random function generation are still publicly available.
High. Exploit is easy to reproduce and allows for cheating during the winner selection process.
Manual check.
Select a different, verified source of randomness, for example Chainlink VRF.
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.