checkList()
function inside SantaList.sol
can be called by any user. The intended purpose of this function is to be called by the santa
only.
The checkList()
function has to be called by the santa only. But the access control check was not done in the contract.
The inline @notice
mentioned that it should only be called by santa
Comment: https://github.com/Cyfrin/2023-11-Santas-List/blob/886f801daa1968cccccfd8790a510417aedc88b6/src/SantasList.sol#L116
The impact of this vulnerability is it can be called by anyone, so any user can easily pass the initial check for the present.
Proof of Code:
Add this piece of code to the SantasListTest.t.sol
. Run the following command to execute test.
forge test --mt testCheckListByAnyone
Manual Review
Add the onlySanta
modifier to the 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.