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

[H-2] Weak randomness in `OneShot::_battle` allows users to influence or predict the winner of the battle

Summary

Weak randomness because of msg.sender, block.timestamp, and block.prerandao hash.

Vulnerability Details

Hashing msg.sender, block.timestamp, and block.prerandao together creates a predictable number. Malicious users can manipulate
these values or know them ahead of time to choose the winner of the raffle themselves

Validators can influence block.timestamp

Impact

Any user can influence the winner of the battle, and winning the money.

Tools Used

Recommendations

Consider using a cryptographically provable random number generator such as Chainlink VRF and do not use block.timestamp

Updates

Lead Judging Commences

inallhonesty Lead Judge over 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.