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

DOS AT THE WITHDRAWFEE FUNCTION

Summary

Vulnerability Details

the require statement in this function can expose the contract to a DOS attack of the withdrawFee function.
'''
function withdrawFees() external {
require(address(this).balance == uint256(totalFees), "PuppyRaffle: There are currently players active!");
'''

say if someone selfdistruct into the contract, the require statement wont be valid anymore and calling withdrawFee function will keep throwing error. This will allow the contract to keep accruing the fee till someone exploit the reentrancy in the refund function and wipe off the contract fund entirely. note that changing feeAddress wont solve this problem.

Impact

the fee from the games continues being in the contract forever or till the contract get exploited through the vulnerable refund function.

Tools Used

remix

Recommendations

modify this statemente
'''
require(address(this).balance == uint256(totalFees), "PuppyRaffle: There are currently players active!");
'''

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 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.