In the SantasList contract only Santa is to be allowed to call SantasList::checkList but anyone call the function as it lags necessary access control. The SantasList::checkList() function modifies the s_theListCheckedOnce mapping, thus anyone can update it as the function doesn't have access control check.
This vulnerability exists in the SantasList::checkList function in the SantasList.sol file starting on line 121.
The function checkList lags the access control to only allow santa to call it as a result of which anyone can call the function
The contract NatSpec mentions that only santa is allowed to call the checkList function but anyone can call it leading to unwanted changing of the user's status and make it difficult for the user to collect their present.
Include the below event in the test/unit/SantasListTest.t.sol file just before setUp function.
Include the below tests in the file test/unit/SantasListTest.t.sol
Run it by:
The below test involves notSanta as the attacker who checks the List as there is no access control.
Run it by:
Manual Review, Foundry Tests
Add the required access control onlySanta
check to the SantasList::checkList function.
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.