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

status is by default Nice for users has not passed checkList function

Summary

In checkTwice function, an unsafe check is used to detect user's status in first check.

Vulnerability Details

If s_theListCheckedOnce does not have a key of certain address, s_theListCheckedOnce[person] by default equals 0. In enum Status, NICE is also equal to 0. Thus, all addresses not in s_theListCheckedOnce has a status of NICE by default.

Impact

checkTwice function can assign s_theListCheckedTwice[address] to NICE for those addresses not a key in s_theListCheckedOnce

Tools Used

Foundry

Recommendations

change the first element in enum Status to be "UNKOWN" instead of "NICE"

Updates

Lead Judging Commences

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.