liquidation factor < collateral factor for Sigma type
The liquidation factor for Sigma-type assets was set lower than the collateral factor, so a user could borrow up to 45% of their collateral but be immediately liquidated because the liquidation threshold was only 40%. This could cause users to lose funds right after taking a maximum loan.
Submitted by cmichel, also found by gzeon
The MochiProfileV0 defines liquidation and collateral factors for different asset types. For the AssetClass.Sigma type, the liquidation factor is less than the collateral factor:
function liquidationFactor(address _asset)
public
view
override
returns (float memory)
{
AssetClass class = assetClass(_asset);
if (class == AssetClass.Sigma) { // } else if (class == AssetClass.Sigma) {
return float({numerator: 40, denominator: 100});
}
}
function maxCollateralFactor(address _asset)
public
view
override
returns (float memory)
{
AssetClass class = assetClass(_asset);
if (class == AssetClass.Sigma) {
return float({numerator: 45, denominator: 100});
}
}
This means that one can take a loan of up to 45% of their collateral but then immediately gets liquidated as the liquidation factor is only 40%. There should always be a buffer between these such that taking the max loan does not immediately lead to liquidations:
A safety buffer is maintained between max CF and LF to protect users against liquidations due to normal volatility. Docs
Recommended Mitigation Steps
The max collateral factor for the Sigma type should be higher than its liquidation factor.
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
The liquidation factor for Sigma assets was set lower than the collateral factor, removing the safety buffer.
Impact
Users could be immediately liquidated after taking a maximum loan, potentially losing collateral.
What the attacker needed
Sigma-type asset; borrow at max collateral factor
The fix
The max collateral factor for Sigma should be set higher than its liquidation factor to maintain a safety buffer.
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 lending systems, the collateral factor is how much you can borrow against your deposit, and the liquidation factor is the point where your loan gets liquidated. Here, the liquidation point was lower than the borrowing limit, so borrowing the maximum meant you were instantly liquidatable.
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.