Mystery Box

First Flight #25
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Valid

Insecure Random Number Generation

Summary

On line 47 within openBox() a random number is being generated using the following:

uint256(keccak256(abi.encodePacked(block.timestamp, msg.sender)))

which is an insecure method of generating randomness.

Vulnerability Details

This method of generating randomness is dependent on block.timestamp which can be manipulated by miners. This will essentially allow them to influnece the value of the random number generated.

Impact

The impact of this is that miners will be able to consistently target and win a high reward and in essence cheat the system.

Tools Used

Manual Review

Recommendations

Use a trusted source such as Chainlink VRF which allows for provable randomness.

Updates

Appeal created

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

Weak Randomness

Support

FAQs

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

Give us feedback!