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

Everyone is NICE by default

Summary

NICE is the first value in Status enum which then equals to 0.

Everyone is then considered NICE by default without any need to call checkList or checkTwice

Vulnerability Details

As NICE value is the first one in Status enum, it corresponds to value 0.

Mappings s_theListCheckedOnce and s_theListCheckedTwice provides the value 0 for adresses which are not mapped yet.

As this value corresponds to the NICE status, everyone is considered NICE by default.

Impact

Any address could call collectPresent function and then collect the NFT before any call to checkList or < checkTwicewas done on that address.

Tools Used

Manual

Recommendations

It is recommended to add UNKNOWNstatus ad the beginning of the Status enum.

enum Status {
UNKNOWN,
NICE,
EXTRA_NICE,
NAUGHTY,
NOT_CHECKED_TWICE
}
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.