The rarity random number generation of the PuppyRaffle::selectWinner function can be gamed to mint the rare and legendary NFTs with a predictability attack.
During the selectWinner unprotected function call, I can exploit the contract by minting the not-so-common NFTs. To do this, say I want to mint the st. bernard NFT, I call the function only when the rarity equals 95 to mint the st. bernard NFT. As a follow-up to my previous report about exploiting the function to make myself the winner, I could now create a 2-attack vector which allows me to select myself as a winner and also mint a rare or legendary NFT whenever I am the winner.
This is possible because I just need to call the selectWinner function when the randomness generated in my attack contract matches what the selectWinner randomness will be looking to get.
Manual review
Use the Chainlink VRF function to generate proveably fair numbers.
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.