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

`RapBattle::_battle` uses a weak PRNG resulting in an exploitable and predictable outcome

Summary

Weak PRNG due to a modulo on block.timestamp.

Vulnerability Details

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

Impact

This can be exploited by miners to influence the outcome of the battle.

Tools Used

Slither

Recommendations

Do not use block.timestamp as a source of randomness

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.