The code does not include reentrancy protection when sending funds or making external contract calls. An attacker could potentially exploit this vulnerability to re-enter the contract and manipulate the state.
Consider the selectWinner function:
This function performs various actions, including selecting a winner and sending funds to that winner. However, it does not include reentrancy protection, which could allow a malicious external contract to call it repeatedly, potentially draining the contract's balance.
This function performs various actions, including selecting a winner and sending funds to that winner. However, it does not include reentrancy protection, which could allow a malicious external contract to call it repeatedly, potentially draining the contract's balance.
Manual/VsCode
To mitigate this issue, you should add the nonReentrant modifier from the OpenZeppelin ReentrancyGuard library to functions that perform sensitive state changes. Here's how you can do it:
By adding the nonReentrant modifier, you protect the selectWinner function from reentrancy attacks. This ensures that the function can't be called again while it's still processing, preventing potential exploits.
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.