withdrawFees strict balance checkPuppyRaffle::withdrawFees (src/PuppyRaffle.sol:158) requires address(this).balance == uint256(totalFees) before paying out. An attacker can permanently break this exact equality by force-sending ETH into the contract via selfdestruct (or a pre-funded create2 address), since forced transfers bypass receive/fallback and increase the balance without updating totalFees.
Likelihood:
Medium. selfdestruct-forced ETH is a well-known, low-cost griefing primitive any address can execute. The attacker needs only a small amount of ETH and no special relationship to the protocol.
Impact:
Medium. Once address(this).balance exceeds totalFees, the equality can never be satisfied again, so withdrawFees reverts permanently and all accumulated fees are locked in the contract with no recovery path. The fee address is denied its rightful funds.
A tiny attacker contract self-destructs into the raffle, after which withdrawFees always reverts.
Track withdrawable fees explicitly instead of comparing against the contract's raw balance.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.