Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Valid

Forcefully sending ether can DoS withdrawFees()

Summary

Attacker can forcefully send ether to the contract to DoS withdrawFees().

Vulnerability Details

withdrawFees() checks if contract's balance is equal to totalFees:

function withdrawFees() external {
require(address(this).balance == uint256(totalFees), "PuppyRaffle: There are currently players active!");
...
}

Attacker can forcefully send ether to the contract via selfdestruct(), even 1 wei suffices. That extra ether will make address(this).balance > uint256(totalFees) so that the require statement will always revert, therefore put withdrawFees() into DoS state.

Impact

Fees will be stuck in the contract.

Tools Used

Manual review

Recommendations

Use other methods to check if there are still active players.

Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

greifers-send-money-to-contract-to-block-withdrawfees

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!