TwentyOne

First Flight #29
Beginner FriendlyGameFiFoundrySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

Missing a check in dealersHand

Summary

In function dealresHand is mising a check for cardValue ==0.

Vulnerability Details

When cardValue is being calculated we might get 13 % 13 from

uint256 cardValue = dealersDeck[player].dealersCards[i] % 13;

which will set the value to 0 and whitout the check 0 will be added to dealerTotal.

Impact

Whitout the check the dealer will have less point in total than he shoud.

Tools Used

Manuel review.

Recommendations

I recommend to include another check next to cardValue>=10, so if you recive 0 it will add 10 points to dealerTotal.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Asymmetric calculation of hands is rigged in the player`s favor.

Support

FAQs

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