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

User can steal the money in the contract because `random` is not really a random number.

Summary

The _battle function calculated a random uint256 based on block.timestamp, block.prevrandao, msg.sender and totalBattleSkill which is not a really random number.

Vulnerability Details

All of the values used to generate a random number can be predicted/calculated, furthermore block.prevrandao on Arbitrum returns 1.
This means a malicious user can calculate the outcome of a battle and use it to steal all the funds in the contract.

Impact

High as a malicious user can calculate the random number and use it to win battles.

Tools Used

Recommendations

Use Chainlink VRF or similar service.

Updates

Lead Judging Commences

inallhonesty Lead Judge almost 2 years 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.

Give us feedback!