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

DoS issue in withdrawFees()

Summary

withdrawFees() has a strict check against address(this).balance such that bad actors could intentionally send in 1 wei to DoS it.

Vulnerability Details

The address(this).balance == uint256(totalFees) check could be easily manipulated by sending 1 wei into the PuppyRaffle contract. Since there's no payable fallback function in PuppyRaffle, we could use the selfdestruct to achieve that as follows:

contract Exp {
constructor() public payable {
}
function kill(address bene) external {
selfdestruct(payable(bene));
}
}

When we create a Exp contract with 1 wei paid and kill() it with PuppyRaffle address, address(this).balance would be uint256(totalFees) + 1 such that the check in withdrawFees() would not pass.

Impact

Fees cannot be collected

Tools Used

Manual review

Recommendations

Check players.length to see if there's any active palyer

Updates

Lead Judging Commences

Hamiltonite Lead Judge over 1 year 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.