External Call Before State Update: The function makes an external call to msg.sender before updating the pendingWinnings[msg.sender] state variable.
Potential for Reentrancy: Even though the function has a nonReentrant modifier, a malicious contract receiving the ETH could:
Implement a receive() or fallback() function
Call back into the contract through other functions
Potentially manipulate state or cause unexpected behavior
Reentrancy Guard Limitation: While the nonReentrant modifier prevents direct reentrancy into the same function, it doesn't prevent:
Cross-function reentrancy (calling other functions in the contract)
Complex attack vectors involving multiple transactions
State manipulation through other entry points
Direct Loss: Potential theft of accumulated prize pools
Indirect Loss: Loss of user trust and platform reputation
Scale: Risk scales with the size of prize pools (could be substantial in popular games)
Game Disruption: Could break the game's economic model
Recovery Difficulty: May require contract redeployment and user migration
Regulatory Risk: Could expose platform to legal liability
Likelihood:
Factors Increasing Likelihood:
Public Code: Contract code is likely public, making vulnerability analysis easier
Financial Incentive: Direct monetary gain motivates attackers
Low Barrier: Relatively simple to exploit once identified
Pattern Recognition: Well-known vulnerability pattern in DeFi
Factors Decreasing Likelihood:
Reentrancy Guard: The nonReentrant modifier provides some protection
Specific Conditions: Attacker must be a legitimate winner to exploit
Detection Risk: Suspicious activity could be detected and stopped
Impact:
The reentrancy vulnerability in withdrawWinnings() has several critical impacts:
Fund Drainage: Malicious actors can potentially drain the contract's ETH balance
Game State Manipulation: Could disrupt the game's integrity and fairness
Winner Privilege Abuse: Multiple withdrawals of the same prize amount
Contract Insolvency: Could leave legitimate winners unable to withdraw their prizes
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.