Wrong if condition in checkTwice function results in Denial of Service (DOS).
The if condition forces the s_theListCheckedOnce variable to be same as status variable selected by the Santa, i.e., checkTwice function always depends on the s_theListCheckedOnce variable value.
And due to the vulnerability already present in function checkList, anyone can call checkList function and change the s_theListCheckedOnce variable.
Hence, attacker can always change the status of s_theListCheckedOnce variable set by Santa before Santa can call checkTwice function due to attacker front running the Santa.
Due to this if condition and front running by the attacker, Santa can never change the s_theListCheckedTwice variable's value.
Hence, making the contract unusable for any user or santa.
To execute this test : forge test -vvvvv
Manual Review
To mitigate the vulnerability, if condition should be removed. There is no requirement of if condition in the logic of checkTwice function.
Here's how you can modify the 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.