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

Missing Permission Modifier on `SantasList::checkList` so anyone can set `Status`

Summary

The SantasList::checkList function is missing the onlySanta() modifier. Instead of just Santa, anyone can change the Status of s_theListCheckedOnce.

Vulnerability Details

function checkList(address person, Status status) external {
s_theListCheckedOnce[person] = status;
emit CheckedOnce(person, status);
}

Above function should have the modifier onlySanta(), so that the modification of s_theListCheckedOnce is restricted.

Impact

function testCheckListAnyoneCanModifiy() public {
// user who is not santa
vm.prank(user);
santasList.checkList(user, SantasList.Status.NICE);
vm.stopPrank();
assertEq(uint256(santasList.getNaughtyOrNiceOnce(user)), uint256(SantasList.Status.NICE));
}

Test proofs that anyone can call function and modify status of a specific user.

Tools Used

  • foundry

Recommendations

Add modifier onlySanta() to function SantasList::checkList.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Access Control on checkList()

Anyone is able to call checkList() changing the status of a provided address. This is not intended functionality and is meant to be callable by only Santa.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.