This PoC highlights the critical vulnerability in the "PuppyRaffle" contract due to its reliance on weak randomness generation, which enables an attacker to predict and manipulate the outcome of the raffle.
There is also weak randomness in the logic to select rarity of NFT such that they can win the rarest of items.
The "PuppyRaffle" contract utilizes a weak source of randomness based on keccak256 with easily predictable inputs, including msg.sender, block.timestamp, and block.difficulty. This predictable randomness generation mechanism allows an attacker to influence the selection of the raffle winner.
The consequence of weak randomness is that malicious actors can repeatedly exploit the raffle by predicting the outcome. This compromises the fairness of the raffle, negatively impacting honest participants and potentially causing financial losses.
VSCode
To address this vulnerability, it is strongly advised to implement secure randomness generation using trusted external oracles, such as Chainlink VRF (Verifiable Random Function), or other reputable sources of randomness. Secure randomness generation is crucial to ensure the integrity and fairness of the raffle.
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.