Eggstravaganza

First Flight #37
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

Pseudo-Random Number Generation Vulnerability

Summary

Location: EggHuntGame.sol, searchForEgg() function

Vulnerability Details

uint256 random = uint256(

keccak256(abi.encodePacked(block.timestamp, block.prevrandao, msg.sender, eggCounter))

) % 100;

Impact

  • Miners can manipulate block.timestamp and block.prevrandao

  • Users can predict outcomes by frontrunning transactions

  • Game fairness can be compromised

Tools Used

manual review

Recommendations

  • Use a commit-reveal scheme or oracle-based randomness

  • Consider using Chainlink VRF for verifiable randomness

Updates

Lead Judging Commences

m3dython Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Insecure Randomness

Insecure methods to generate pseudo-random numbers

Support

FAQs

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