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

Potential to Bypass the Initial Check in the If Statement

Summary

Potential to Bypass the Initial Check in the If Statement

Vulnerability Details

Due to the default value of the Status enum being set to NICE, it is possible for the checkTwice function to pass the if statement even when the checkedOnce status has not been assigned. This occurs when an operator calls checkTwice with a NICE status without previously assigning checkedOnce, leading to unintended behavior.

Impact

There's a risk that the checkedTwice status might be assigned without the prerequisite checkedOnce status being set, which could lead to incorrect system behavior or data integrity issues.

Tools Used

Recommendations

The default value of the Status enum should be changed. Additionally, implement a check to confirm whether checkedOnce is set to UNKNOWN or not before proceeding with checkTwice.

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

default status is nice

In Solidity the first element of an enum is the default value. In Santa's List, the means each person is mapped by default to 'NICE'.

Support

FAQs

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