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

Weak PRNG

Summary

Weak Pseudo-Random Number Generator used in ChoosingRam::increaseValuesOfParticipants function.

Vulnerability Details

Hashing msg.sender, block.timestamp, block.prevrandao together creates a predictable final number. A predictable number is not a good random number. Malicious users can manipulate these values or know them ahead of time so that they can be selected as ram.

  1. Validators can know ahead of time the block.timestamp and block.prevrando and use that knowledge to predict when / how to participate. See this article on prevrando here.

  2. Users can mine/manipulate the msg.sender value to result in their address being used to generate a random number in their favour.

  3. Users can revert the ChoosingRam::increaseValuesOfParticipants transaction if they do not like the resulting random number.

Impact

A user can choose which address becomes the ram. Therefore getting the ether rewards sent to the ram.

Tools Used

  • Static Analysis (slither)

  • Manual Analysis

Recommendations

Consider using a cryptographically provable random number generator such as Chainlink VRF.

Updates

Lead Judging Commences

bube Lead Judge
about 1 year ago
bube Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Weak randomness in `ChoosingRam::increaseValuesOfParticipants`

Support

FAQs

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