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

Risk of silent overflow

Summary

Vulnerability Details

In the PuppyRaffle.sol selectWinner(),the uint256fee is forcefully cast to uint64.
In the 2023-07-PoolTogether contest on C4, there is relevant and valid finding for this issue.
You can find it here:
https://code4rena.com/reports/2023-07-pooltogether#m-19-silent-overflow-could-alter-computation-when-calculating-the-vaultportion-in-the-prizepool-contract

Impact

This can potentially result in a silent overflow and may lead to totalFees goes wrong.

Tools Used

Recommendations

Add checks that the casting value is not greater than the uint64 type max value:

if (fee > type(uint64).max) {Overflow();}
Updates

Lead Judging Commences

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

overflow-uint64

Support

FAQs

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

Give us feedback!