20,000 USDC
View results
Submission Details
Severity: medium

Lenders get charged a borrower fee upon liquidating a user

Summary

The lender of a loan that gets liquidated trough seizeLoan() pays a borrower fee in collateral tokens without there being a reason to do so.

Vulnerability Details

The lender of a loan that gets liquidated trough seizeLoan() pays a borrower fee in collateral tokens without there being a reason to do so, which puts the lender into an even bigger loss after getting the insufficient collateral of a loan after it needed to be liquidated.

uint256 govFee = (borrowerFee * loan.collateral) / 10000;
// transfer the protocol fee to governance
IERC20(loan.collateralToken).transfer(feeReceiver, govFee);
// transfer the collateral tokens from the contract to the lender
IERC20(loan.collateralToken).transfer(
loan.lender,
loan.collateral - govFee
);

There is no basis, upon which to charge the lender a fee in this case.

Impact

The lender will get charged an additional one-time fee.

Tools Used

Manual Review

Recommendations

Consider removing the logic for charging the lenders a liquidation fee in this case.

Support

FAQs

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