Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Invalid

Weak sources of Randomness

Summary

Using block.timestamp and block.prevrandao as a sources of randomness is not advised, as the outcome can be manipulated by the miners or validators.

Vulnerability Details

https://github.com/Cyfrin/2024-06-Dussehra/blob/main/src/ChoosingRam.sol#L51-L52

uint256 random =
uint256(keccak256(abi.encodePacked(block.timestamp, block.prevrandao, msg.sender))) % 2;

Here, we see that block.timestamp and block.prevrandao are used in order to generate a random number. However, use of block.timestamp and block.prevrandao is insecure and not advised.

Impact

Incorrect randomness

Tools Used

Manual Review

Recommendations

Using external sources of randomness via oracles like Chainlink VRF.

Updates

Lead Judging Commences

bube Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Too generic
Assigned finding tags:

Weak randomness in `ChoosingRam::increaseValuesOfParticipants`

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.