A malicious contract can drain the puppy raffle contract through reentrancy in the refund() function.
A malicious contract can deposit once as the entry fee and immediately call refund(). Then in the fallback, continue to call the refund function while the contract balance is still above or equal to the entrancyFee.
Since there is no reentrancy guard and since the raffle contract is not following CEI or FREI-PI pattern, the contract is vulnerable.
The contract can be drained of its ETH.
manual review
Add a reentrancy modifier like OpenZeppelin's nonReentrant and follow CEI or FREI-PI patterns to prevent reentrancy risk.
reentrancy in refund() function
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.