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

Mapping getter functions will return NICE status for addresses not in mapping.

Summary

This external view function will return enum value NICE for addresses not currently in the mapping.

Vulnerability Details

When mapping a value to an enum in solidity, if the address has not been set in the mapping, the query will always return the first value of the enum, which is 'NICE'.

Impact

this is low impact as it is external view, but may lead to confusion and a bad UX.

Tools Used

Manual Review

Recommendations

Reorder the enum so naughty is first, and document well that an address uninitialized may return NAUGHTY, but it is worse if it returns NICE incorrectly.

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.