-
Notifications
You must be signed in to change notification settings - Fork 14
peanuts - Max collateral check is not done when increasing collateral balance #37
Comments
Escalate This is not a duplciate of #86. Furthermore, it is invalid. maxCollateral represents a maximum amount of collateral a borrower wishes to give, and it is provided by the borrower in the |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
Agree with the above comments. |
Will be accepting the escalation and making this submission invalid. |
Result: |
Escalations have been resolved successfully! Escalation status:
|
peanuts
medium
Max collateral check is not done when increasing collateral balance
Summary
There is no max collateral check when increasing the collateral balance using
increaseCollateralBalance()
Vulnerability Detail
When a user calls
borrow()
, there is a check forborrowingCollateral
. The check makes sure thatborrowingCollateral
is not greater thanmaxCollateral
maxCollateral
is defined as the maximum amount of collateral that can be provided for the loan.However, when
increaseCollateralBalance
is called, themaxCollateral
variable is not checked.Impact
Without checking
maxCollateral
, the leverage position may be unnecessarily overcollaterized.Code Snippet
https://github.com/sherlock-audit/2023-10-real-wagmi/blob/main/wagmi-leverage/contracts/LiquidityBorrowingManager.sol#L371-L383
Tool used
Manual Review
Recommendation
Recommend checking the max collateral amount when calling increase collateral balance
The text was updated successfully, but these errors were encountered: