In the ChristmasDinner contract a host can change his/her status to a non-participant for the event.
The vubrability is exposed when someone that is a host calls the changeParticipationStatus function that changes the his/her participant status(when the first if statement in the function is entered). This contradicts the logic in the changeHost function that states that the host must attend the event when chaning ownership.
The vulnerability exposes a situation where the person is not planning to attend the event but is still marked as the host. This means that noone except him/her can withdraw the funds in the contract and take over the organization and expenses. In this case the host needs to transfer the rights to another person but since he/she is not attending the event he/she could stopped following the events around it.
Manual Review
Foundry testing
We can add a check in the changeParticipationStatus function to validate that we are not changing the host user to a non-participant. We do this check at the top of the function to avoid gas consumption by modifying storage values. We also verify that this is done before the deadline as we know that after the deadline is passed we can still change the host but this needs to be done outside of the contract, we might still want to mark that the host is no longer the one stated in the contract.
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.