Weak randomness can be precalculted and exploited by malicious users
Generating random numbers based on block data is not secure, as a malicious contract can precalculate it and make decisions in its favor. In this case, a hash generated from block.timestamp, block.prevrandao, and msg.sender is being used.
Furthermore, in Arbitrum, block.prevrandao is a constant, so the randomness is further diminished.
With this a malicious user can guess the outcome of ChoosingRam::increaseValuesOfParticipants
.
I should note also the vulnerability is present in the function ChoosingRam::selectRamIfNotSelected
, in this case a miner can hold on to the transaction until the output is favorable and executes the transaction
A malicious user can use the weak randomness in order to bruteforce the function choosingRam::increaseValuesOfParticipants
be selected as Ram, kill ravana and win half the pot.
A malicious miner can use the weak randomness in order to wait for the right bock to be selected as Ram, kill ravana and win half the pot.
Foundry
Implement a solution with a verifiable source of randomness, such as Chainlink VRF, to ensure that the randomness cannot be predicted or manipulated by attackers.
By using Chainlink VRF, you can replace the insecure randomness generation with a verifiable and secure random number. This approach ensures that the randomness is truly unpredictable and prevents attackers from exploiting it.
The organizer is trusted, but the function `ChoosingRam::selectRamIfNotSelected` uses a way to generate a random number that is not completely random.
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.