In the documentation its specified that the checkList() is only callable by the Santa.
But here you forget to add the onlySanta modifier in checkList() .
Any attacker can call the chcekList function and set its initial status either naughty or nice.
* @notice Do a first pass on someone if they are naughty or nice.
* Only callable by santa
* @param person The person to check
* @param status The status of the person
*/
function checkList(address person, Status status) external {
s_theListCheckedOnce[person] = status;
emit CheckedOnce(person, status);
}
function testCheckList1() public {
vm.prank(attacker);
santasList.checkList(user, SantasList.Status.NICE);
assertEq(uint256(santasList.getNaughtyOrNiceOnce(user)), uint256(SantasList.Status.NICE));
}
Manual Review.
function checkList(address person, Status status) external onlySanta {
s_theListCheckedOnce[person] = status;
emit CheckedOnce(person, status);
}
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.