If the withdrawFees transaction fails, the contract updates totalFees to 0 before verifying a successful transfer, leading to a scenario where fees are permanently locked in the contract.
The withdrawFees function first sets totalFees = 0 before attempting to transfer the funds. If the transfer fails (e.g., due to a malicious recipient rejecting ETH transfers), the contract still updates totalFees, making it impossible to withdraw the locked funds in future attempts.
Funds are permanently locked inside the contract.
Owners cannot recover fees, leading to potential financial losses.
Denial of Service (DoS) risk if an attacker exploits this to prevent withdrawals.
Manual review
Update totalFees only after a successful transfer:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.