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

Missing onlySanta modifier

Summary

onlySanta modifier isn't applied in function which should be callable only by santa.

Vulnerability Details

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

onlySanta modifier isn't applied in checkList function.

Impact

Users which are checked only once cannot do anything in contract however opening this function to all users opens attack vector for frontrunning attack leading santa being unavaiable to check user second time using checkTwice.

    1. Santa call checkTwice to check user second time (e.g. EXTRA_NICE).

    1. Attacker can frontrun santa's call by calling checkList function and setting user's status value to different one than santa entered in his call (e.g. NICE).

    1. santa's checkTwice function call will revert because user's status values doesn't match.

function checkTwice(address person, Status status) external onlySanta {
@> if (s_theListCheckedOnce[person] != status) {
revert SantasList__SecondCheckDoesntMatchFirst();
}
s_theListCheckedTwice[person] = status;
emit CheckedTwice(person, status);
}

Tools Used

  • foundry

Recommendations

Add onlySanta modifier to checkList function.

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.