PuppyRaffle::selectWinner
winner allows anyone to choose winnerDescription:
Using the Pseudo randomness everyone can make a setup to check when to call the selectWinner
method to make himself the winner.
Impact:
Cheating the raffle will make it less attractive to users
Tools used:
foundry
Proof of Concept:
Recommended Mitigation:
To prevent the exploitation of the vulnerability outlined above should avoid using block.timestamp
as sources of randomness in situations where true randomness is crucial. Instead, consider the following preventative techniques:
Oracles: Use decentralized oracles that provide external randomness sources. These oracles can fetch unpredictable data from off-chain sources, enhancing the randomness of the generated values.
Chainlink VRF: Leverage Chainlink’s Verifiable Random Function (VRF) to generate secure random numbers. Chainlink VRF uses multiple inputs to produce a random value that can be verified on-chain.
Commit-Reveal Schemes: Implement commit-reveal schemes where participants commit to values in advance and reveal them later. This introduces an additional layer of unpredictability.
External Contracts: Interact with other smart contracts that specialize in randomness generation. These contracts might utilize more secure mechanisms to ensure randomness.
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.