Mystery Box

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

Weak source of randomness in `MysteryBox::openBox`

Summary

`block.timestamp` together with `msg.sender` together they create a predicatble number. Predicatble number is not a good random number.

Vulnerability Details

Impact

User/Miner can predict the result of `uint256(keccak256(abi.encodePacked(block.timestamp, msg.sender))) % 100`; therefore can win the Gold coin or another rare item.

Tools Used

Manual Review

Recommendations

Do not use block.timestamp as a source of randomness
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago

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!