The `withdraw()` function uses `transfer()` to send ETH to a target address. While `transfer()` only forwards 2300 gas, if the target is a contract with a malicious fallback function, it could potentially reenter the contract before state updates are complete, though the current implementation has limited state to manipulate.
The normal behavior should follow the checks-effects-interactions pattern, ensuring all state changes occur before external calls. The current implementation performs the transfer before any state changes, but since there are minimal state changes in this function, the risk is lower.
```solidity
function withdraw(address target) external onlyOwner {
payable(target).transfer(address(this).balance); // @> External call before state updates
}
```
Likelihood:
* Target address must be a malicious contract with a fallback function
* `transfer()` only forwards 2300 gas, limiting attack surface
* Current function has minimal state to manipulate
* Requires owner to set malicious address as target
Impact:
* Potential reentrancy attacks if state is modified in future updates
* Best practice violation that could lead to vulnerabilities
* If contract is extended, reentrancy could become critical
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.