The _refundERC20() function in the ChristmasDinner contract allows any address to request token refunds without validating whether they have deposited any tokens or are registered participants, potentially enabling unauthorized withdrawals.
The _refundERC20() function is called internally by the refund() function and attempts to transfer WETH, WBTC, and USDC tokens to the requesting address without any validation:
Key issues:
Missing input validation that the address requesting refund is a registered participant
No checks that the address has any token balances to refund
While the actual token transfers would revert for zero balances due to the use of safeTransfer, this represents an access control risk as any address can trigger refund attempts
Manual code review
Add participant validation by requiring them to be tracked in the participantmapping.
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.