Submitted by hickuphh3, also found by BondiPestControl, GimelSec, sseefried, and VAD37
vault.durationDays is of type uint8, thus allowing a maximum value of 255. 1 days = 86400, thus fitting into a uint24. Solc creates a temporary variable to hold the result of the intermittent multiplication vault.durationDays * 1 days using the data type of the larger operand.
In this case, the intermittent data type used would be uint24, which has a maximum value of 2**24 - 1 = 16777215. The maximum number allowable before overflow achieved is therefore (2**24 - 1) / 86400 = 194.
Insert this test case into BuyOption.t.sol
Then run
This was the 1 high-severity bug that I wanted to mention at the end of the C4 TrustX showcase but unfortunately could not due to a lack of time :( It can be found in the vulnerable lottery contract on L39. Credits to Pauliax / Thunder for the recommendation and raising awareness of this bug =p
Article
Cast the multiplication into uint32.
outdoteth (Cally) confirmed and commented:
outdoteth (Cally) resolved:
HardlyDifficult (judge) decreased severity to Medium and commented:
