Open code423n4 opened 3 years ago
cmichel
The function performs type conversions and subtraction without over-/underflow checks:
uint256 check = abs(int256(_ratio) - int256(chainRatios[i].div(CHAIN_FACTOR)));
We recommend checking if the values fit within the type range first, otherwise revert with a meaningful error message, as well as checking for underflows.
This is partially a duplicate of #6 but it focuses on low risk issue so I'll record is as a separate (low risk) issue.
Handle
cmichel
Vulnerability details
Vulnerability Details
The function performs type conversions and subtraction without over-/underflow checks:
Recommended Mitigation Steps
We recommend checking if the values fit within the type range first, otherwise revert with a meaningful error message, as well as checking for underflows.