SantasList::checkList()
is vulnerable to DoS attacks due to a lack of access control. onlySanta
modifier is missing on this function.
SantasList::checkTwice
and SantasList::collectPresent
expect SantasList::s_theListCheckedOnce
and SantasList::s_theListCheckedTwice
to have the same value for a given user.
Futhermore a malicious user can DoS anyone by calling SantasList::checkList()
with the desired status (NAUGHTY). This prevents the DoSed user from being checked twice and collect present, even this user is in fact NICE or EXTRA_NICE.
Place the code for the following test functions in test/unit/SantasListTest.t.sol
.
In the terminal, run the following commands:
forge test --mt test_CheckTwice_DoS
forge test --mt test_CollectPresent_DoS
SantasList::checkTwice()
and SantasList::collectPresent()
can be made to always revert.
Manual review, Foundry
Add the onlySanta
modifier to SantasList::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.
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.