withdrawFees()
is used to transfer the accumulated fees to the feeAddress. However, a notable issue is that the function always reverts if anyone sends ether directly to the contract
withdrawFees()
has a require(address(this).balance == uint256(totalFees)
to verify the presence of active players. The issue arises when someone sends only 1 wei to the contract, preventing the require condition from being met. This situation can lead to DOS attack, effectively blocking the funds within the contract. The vulnerability arises from the use of address(this).balance
in the comparison, and an attacker can exploit this by creating a malicious contract with a selfdestruct()
pointing to the contract, ensuring that the require condition is never satisfied.
DOS provocating a lock of funds.
Manual review
Instead of using address(this).balance
use a virtual balance to store the balance of the contract.
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.