The vulnerability in the "selectWinner" function arises from the use of a uint64 data type to store the "totalFee." .
A uint64 has a maximum value of 18,446,744,073,709,551,615 wei. If at any point during the raffle, the accumulated fees exceed this threshold (18.45 ether), an overflow occurs. When an overflow happens, the value "totalFee" will not be represented correctly due to exceeding the data type's maximum limit
The overflow vulnerability can have critical consequences, potentially leading to inaccurate representation of fees and disrupting the fair selection of a winner in the raffle. Any surplus fees above the uint64 maximum value will not be captured correctly, affecting the integrity of the raffle and the distribution of funds.
Manual
- uint64 public totalFees = 0;
+ uint256 public totalFees = 0;
- totalFees = totalFees + uint64(fee);
+ totalFees = totalFees + (fee);
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.