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

Enum `Status` has incorrect default value

Summary

Enum Status has incorrect default value

Vulnerability Details

SantasList::Status enum has NICE, EXTRA_NICE, NAUGHTY, NOT_CHECKED_TWICE as possible values. The issue is, only Santa can give you one of the NICE or EXTRA_NICE status. As this enum is used as the value both mappings s_theListCheckedOnce and s_theListCheckedTwice, all addresses will have default value NICE.

Additionally, NOT_CHECKED_TWICE status has no use.

Impact

HIGH. Breaks main protocol functionality.

Tools Used

  • Manual Review

Recommendations

Consider updating the enum declaration as follows:

enum Status {
NAUGHTY,
NICE,
EXTRA_NICE
}

This will give `NAUGHTY as the default status, and then have the other 2 status to be set by Santa.

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.