increaseCollateralAmount : User is not allowed to increase collateral freely
The vault contracts require that a user's collateral value be at least the borrow margin when adding collateral, which prevents users from gradually increasing collateral to avoid liquidation. An attacker could not exploit this, but it may lead to unnecessary liquidations and protocol losses.
rvierdiiev Follow with ak1 and bin2chen
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2022-11-isomorph-judging/issues/229
Found by
rvierdiiev, ak1, bin2chen
Summary
For all the tree type of vault, a user is allowed to increase collateral only if the overall collateral value is higher than the margin value.
imo, this restriction may not be needed. anyway user is adding the collateral that could eventually save from liquidation.
Protocol will loose advantage due to this restriction.
Vulnerability Detail
Codes from lyra vault implementation :
Line 184
require(colInUSD >= borrowMargin, "Liquidation margin not met!");
For synth - Refer here
For velo - Refer here
Impact
User may not have the collateral all at once, but they can add like an EMI.
Protocol will loose the repayment anyway.
What is no one comes for liquidation - again this could lose.
Code Snippet
Refer vulnerability section
Tool used
Manual Review
Recommendation
Allow user add collateral freely.
Discussion
kree-dotcom
Fixed https://github.com/kree-dotcom/isomorph/commit/6b403bad09388fca0153b843a2e552b5e3d235cd
0x00052
Fixes look good. Liquidation margin check has been removed when adding collateral
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the addCollateral function includes a check that the total collateral value must meet the borrow margin, which is unnecessary and restrictive.
Impact
Users may be unable to add collateral in small amounts, potentially leading to liquidation and protocol losses.
What the attacker needed
None
The fix
The liquidation margin check was removed when adding collateral, as confirmed by the fix.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In a lending system, you must keep enough collateral to cover your loan. This report says the system won't let you add more collateral unless you already have enough, which stops people from topping up gradually to avoid being liquidated. It's a design flaw, not a security hole.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.