15,000 USDC
View results
Submission Details
Severity: high
Valid

When liquidate, totalCollateralToRedeem may larger than borrower collateral balacne

Summary

When liquidate, totalCollateralToRedeem may larger than borrower collateral balance , because there is no limitation on weather totalCollateralToRedeem > borrower collateral balance

Vulnerability Details

In function liquidate, liquidator supply dsc to redeem dept, suppose a situation, liquidator want repay all dept of borrower.
And off course he will get all the collateral ,but take a look at this

uint256 bonusCollateral = (tokenAmountFromDebtCovered * LIQUIDATION_BONUS) / LIQUIDATION_PRECISION;
uint256 totalCollateralToRedeem = tokenAmountFromDebtCovered + bonusCollateral;
_redeemCollateral(user, msg.sender, collateral, bonusCollateral);

Liquidator would get a bonusCollateral, and
totalCollateralToRedeem is possible > borrower total collateral ,it will fail

Impact

Dos when fully liquidate

Tools Used

manual

Recommendations

recalculate and return the unnecessary dsc to liquidator

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.