Eggstravaganza

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

Randomness Manipulation

Summary

The timeblockstamp seems good for providing randomness, but can be easily manipulated with substracting few seconds, and give the chance to a certain person to attack the contract and predict the randomness calculation

Vulnerability Details

uint256 random = uint256( keccak256(abi.encodePacked(block.timestamp, block.prevrandao, msg.sender, eggCounter)) ) % 100;

Impact

This gives an attacker or miner some control over the value used in the randomness calculation.

Tools Used

n/a

Recommendations

Use Chainlink VRF to avoid this kind of attacks

Updates

Lead Judging Commences

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