Using block.timestamp and block.difficulty as sources of randomness is strongly discouraged, as the outcome can be manipulated and predicted by an attacker.
The randomness generation inside the selectWinner() function, both for the winnerIndex and rariry, is vulnerable since we don't use an oracle to obtain it from outside the blockchain. An attacker can manipulate this to obtain a very rare NFT or even ensure their victory.
An attacker can consistently predict or even secure their victory, and they can also anticipate the type of NFT they will receive.
Manual Review
Consider implementing a decentralized oracle for generating random numbers, such as Chainlink's 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.