Normal Behavior: Post-game, winners/owner withdraw pending winnings or platform fees safely, with nonReentrant guarding recursion and call() sending ETH.
Issue: CEI violated (amount pulled, call sent, then pending=0)—malicious recipient reenters on receive(), withdraws multiples, draining pot/fees in loop till gas out.
Likelihood:
Reason 1: Requires contract king/owner (med, but common in integrations like wallets/DAOs as players).
Reason 2: Reproducible post-end with funds—deterministic reentry on call().
Impact:
Impact 1: Theft—pot/fees drained in loop (multiple pulls before pending=0).
Impact 2: Trust erosion/DoS (contract empty, legit withdrawals fail); real-world: Reentrancy like Cream Finance ($130M loss) from call order.
This Foundry test deploys reentrant contract as king, wins, attacks—withdraw triggers loop draining pot before pending=0.
Flip to CEI (effects before interactions)—update pending before call, blocking reentry (second call sees 0).
We only audit the current code in scope. We cannot make speculation with respect to how this codebase will evolve in the future. For now there is a nonReentrant modifier which mitigates any reentrancy. CEI is a good practice, but it's not mandatory. Informational
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.