Eggstravaganza

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

Weak Randomness

Summary

Vulnerability Details

The searchForEgg function in the EggHuntGame Contract uses a pseudo-random number generation uses block.timestamp, block.prevrandao, msg.sender, and eggCounter. These are predictable or manipulable by miners or users (e.g., timing transactions to influence block.timestamp).

Impact

Players or miners could cheat to increase their egg-finding chances.

Tools Used

manual review

Recommendations

Use a secure randomness source like Chainlink VRF or accept the limitation and document it as a game design choice. For testing, this might be intentional, but it’s insecure for production.

Updates

Lead Judging Commences

m3dython Lead Judge 8 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.

Give us feedback!