TwentyOne

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

Improper Range Validation for Dealer's Stand Threshold

Summary

The standThreshold for the dealer in the call function is calculated in a way that could produce values outside of the desired range of 17 to 21.

Vulnerability Details

The value of standThreshold is derived from a random number, but there is no explicit check to ensure that it falls within the range of 17 to 21. The calculation could result in values that are either too low (below 17) or too high (above 21), which would break standard blackjack rules.

Impact

The dealer could be forced to stand at an invalid threshold, causing an unfair game outcome where the dealer either stands too early or keeps drawing cards unnecessarily.

Tools Used

Manual Code Review

Recommendations

Ensure that the standThreshold is always constrained between 17 and 21. You can adjust the logic to explicitly check for this range before the dealer acts.

Updates

Lead Judging Commences

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

The Dealer's Play - Dealer must stand on 17

Support

FAQs

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