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

Prize rarity depends on msg.sender address

Summary

Prize rarity depends on msg.sender address

Vulnerability Details

block.difficulty == 0 always in PoS. So the rarity of the prize token depends only on the msg.sender that calls the selectWinner() function:
uint256 rarity = uint256(keccak256(abi.encodePacked(msg.sender, block.difficulty))) % 100;

Impact

What rarity of prize token depends exclusively on who calls the selectWinner() function.

Tools Used

Manual review

Recommendations

Use actual randomness -> Chainlink VRF

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

weak-randomness

Root cause: bad RNG Impact: manipulate winner

Support

FAQs

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