Users can liquidate themselves before others, allowing them to take 13% above their borrowers
The canLiquidate function allowed a borrower to liquidate their own loan before it was publicly liquidatable, letting them collect the 13% liquidation fee. This meant the borrower could keep the loaned funds and gain a bonus while lenders suffered a loss.
Submitted by obront, also found by caventa
The canLiquidate() function allows liquidations to take place if either (a) the loan is over and still exists or (b) the caller owns the collateral.
In the second case, due to the liquidation fee (currently 13%), this can give a borrower an unfair position to be able to reclaim a percentage of the liquidation that should be going to their lenders.
Proof of Concept
- A borrower puts up a piece of collateral and takes a loan of 10 WETH
- The collateral depreciates in value and they decide to keep the 10 WETH
- Right before the loans expire, the borrower can call
liquidate()themselves - This sets them as the
liquidatorand gives them the first 13% return on the auction - While the lenders are left at a loss, the borrower gets to keep the 10 WETH and get a 1.3 WETH bonus
Recommended Mitigation Steps
Don’t allow users to liquidate their own loans until they are liquidatable by the public.
SantiagoGregory (Astaria) confirmed
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 canLiquidate function allowed liquidation when the caller owned the collateral, without checking that the loan was actually overdue or that the caller was not the borrower.
Impact
The borrower could keep the loaned funds and gain a 13% bonus, while lenders were left at a loss.
What the attacker needed
A borrower with an active loan; collateral value drops; borrower acts before loan expiry
The fix
The project should prevent users from liquidating their own loans until the loans are liquidatable by the public.
How it was found
- A borrower puts up collateral and takes a loan of 10 WETH.
- The collateral loses value and the borrower decides to keep the 10 WETH.
- Right before the loan expires, the borrower calls liquidate() on their own loan.
- The borrower becomes the liquidator and receives the first 13% of the auction proceeds.
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, if a borrower cannot repay, anyone can liquidate the loan by selling the collateral and taking a fee. Here, the borrower could trigger that liquidation on their own loan early, so they got the fee instead of an outside liquidator, while lenders lost out.
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.