Normal Behavior:
The withdraw(address target) function should safely transfer the contract’s ETH balance to a valid recipient address. It is expected that the function prevents accidental loss of funds by ensuring the recipient is not the zero address.
Issue:
The function does not check if the target address is the zero address. If the owner mistakenly calls withdraw(address(0)), all ETH in the contract will be sent to the zero address and permanently lost. This is a common mistake that can occur due to a misconfigured script, UI bug, or human error.
Likelihood:
This can occur if the owner makes a mistake, a script passes an uninitialized address, or a UI bug submits a zero address.
Impact:
All ETH in the contract can be lost forever if sent to the zero address. This is irreversible and can result in significant financial loss.
Suppose the contract has a balance of 10 ETH. If the owner accidentally calls address(0), All 10 ETH will be sent to the zero address, and are unrecoverable. This can be simulated in a test by calling the function with address(0) and checking that the contract balance drops to zero, but the ETH is not received by any valid account.
Add a check to ensure the target address is not zero. This prevents accidental loss of funds and aligns with best practices for secure contract development.
Owner/admin is trusted / Zero address check - 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.