Submitted by Nexarion, also found by chaduke, SBSecurity, lian886, Drynooo, stacey, jesjupyter, and Rhaydden
The _doCheckValueType function, which is crucial for post-operation validation, contains reversed comparison logic for the gte (greater than or equal to) and lte (less than or equal to) operators. This reversal causes the function to perform the opposite checks than intended, potentially allowing operations to pass validation when they should fail, or fail when they should pass.
This issue could lead to:
The issue is located in the _doCheckValueType function of the LeverageMacroBase contract:
https://github.com/code-423n4/2024-06-badger/blob/9173558ee1ac8a78a7ae0a39b97b50ff0dd9e0f8/ebtc-protocol/packages/contracts/contracts/LeverageMacroBase.sol#L277-L289
Specifically, the problematic comparisons are:
These comparisons are reversed and should be:
To fix this issue:
Context
wtj2021 (Badger) acknowledged via duplicate Issue #18
0xsomeone (judge) increased severity to High
GalloDaSballo (Badger) commented:
0xsomeone (judge) commented:
GalloDaSballo (Badger) commented:
0xsomeone (judge) decreased severity to Medium and commented:
