Rock Paper Scissors

First Flight #38
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Invalid

Missing checks for totalTurns when creating game could lead to DOS

Summary

In project documentation you state that the game could must be 3-5 turns, but when checking the in createGameWithToken() and createGameWithEth() at RockPaperScissors.sol the checks is only for greater than 0.

Vulnerability Details

In createGameWithEth() and createGameWithToken() at RockPaperScissors.sol you used

require(_totalTurns > 0, "Must have at least one turn");

which checks for the _totalTurns must be greater than 0 but with no limit

Impact

If totalTurns is too large, gas limits could be hit.

Tools Used

Manual review

Recommendations

Consider replacing the following lines in both createGameWithEth() and createGameWithToken() at RockPaperScissors.sol

- require(_totalTurns > 0, "Must have at least one turn");
+ require(_totalTurns >= 3 && _totalTurns <= 5, "Turns must be between 3 and 5");
Updates

Appeal created

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational

Code suggestions or observations that do not pose a direct security risk.

Support

FAQs

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