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

Everyone starts as a NICE person, defeating the purpose of the presents

Summary

Mapping of both s_theListCheckedOnce & s_theListCheckedTwice defaults to 0, making them already a nice person and able to claim the presents defeating the purpose of the checks.

Vulnerability Details

function test_anyoneCanClaim() public {
vm.startPrank(attacker);
vm.warp(santasList.CHRISTMAS_2023_BLOCK_TIME() + 1);
santasList.collectPresent();
vm.stopPrank();
}

Impact

Everyone can claim NFT Presents including people not in Santa's list or if Santa forgets to check an individual.

Tools Used

Foundry

Recommendations

Start users out with an UNCHECKED status

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.