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

`SantasList::checkTwice` can be executed before `SantasList::checkTwice`

Summary

SantasList::checkTwice can be executed before SantasList::checkTwice

Vulnerability Details

If Santa calls SantasList::checkTwice with a NICE status for a user, this transaction will pass, although SantasList::checkList was never called before.

SantasList::checkTwice validates if SantasList::s_theListCheckedOnce mapping has the same status that is given in the function execution. But the default value in the mappings is NICE.

Impact

MEDIUM as the function can only be called by Santa anyways.

Tools Used

  • Manual Review

Recommendations

Update the default value of the enum Status from NICE to NAUGHTY.

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.