Closed howlbot-integration[bot] closed 3 months ago
confirmed, fixing in this PR https://github.com/ebtc-protocol/ebtc-zap-router/pull/18
This submission has been identified as very similar to #23, and the contents of both submissions appear highly generic and fail to properly articulate the ramifications of the vulnerability described.
Given that they were generated using the assistance of ChatGPT (or similar generative tools) and did not articulate why the code flaw is a vulnerability, I am inclined to invalidate both submissions as lacking sufficient proof.
alex-ppg marked the issue as unsatisfactory: Insufficient proof
Lines of code
https://github.com/code-423n4/2024-06-badger/blob/9173558ee1ac8a78a7ae0a39b97b50ff0dd9e0f8/ebtc-protocol/packages/contracts/contracts/LeverageMacroBase.sol#L277-L290
Vulnerability details
Impact
The incorrect comparison logic in the
_doCheckValueType
function can lead to incorrect validation of post-operation checks. This will result in the ptotocol not properly verifying the expected conditions, thereby, allowing operations to proceed when they should not, or failing valid operations.Proof of Concept
The
_doCheckValueType
function is intended to check if a value meets certain conditions based on the operator provided. However, there is a mistake in the comparison logic for thegte
andlte
operators.Look at thus part of the code: https://github.com/code-423n4/2024-06-badger/blob/9173558ee1ac8a78a7ae0a39b97b50ff0dd9e0f8/ebtc-protocol/packages/contracts/contracts/LeverageMacroBase.sol#L277-L290
The problem here is with the
gte
andlte
checks. Thegte
(greater than or equal to) check should ensure thatvalueToCheck
is greater than or equal tocheck.value
, and thelte
(less than or equal to) check should ensure thatvalueToCheck
is less than or equal tocheck.value
. However, the current implementation does the opposite.Recommended Mitigation Steps
The comparison logic should be corrected to ensure that the
gte
andlte
checks are performed correctly:Assessed type
Error