MysteryBox::claimAllRewards and MysteryBox::claimSingleReward make state changes only after transfering ether to the destination address. This allows the destinationation address (contract) to make several callbacks to either of the functions and drain off all the funds in the contract.
MysteryBox::claimAllRewards and MysteryBox::claimSingleRewarddid not make state changes before making external call, making them vulnerable to a reentrancy attack. The called address (contract) can callback the MysteryBox::claimAllRewards or MysteryBox::claimSingleReward in the same transaction and drain all the funds in the contract.
All the funds in the contract will be stolen.
manual review.
Refactor the MysteryBox::claimAllRewards and MysteryBox::claimSingleReward as shown below.
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.