20,000 USDC
View results
Submission Details
Severity: medium
Valid

A clever lender can front-run a wealthy borrower and make him pay more interest than it atually was by updating the interest rate.

Summary

A Lender can front-run the borrower in setting an interest rate higher just before the borrower's transaction gets mined.

Vulnerability Details

Let's take a quick example

-> An innocent borrower wants to take a loan of 10 Million x tokens
-> He sees the interest rate to be 5%.
-> He makes calculations
(suppose 1 Million x tokens = 0.05 WBTC )
Total value to be paid = 0.5 WBTC + interest(5%) 0.025 WBTC = 0.525 WBTC

-> He has 1 WBTC
-> He wants to over-collateralize the position with 1 WBTC.
-> He makes a Transaction.
-> At the same time, the clever lender sees the transaction in mempool
-> Lender makes his own transaction to updateInterestRate of the pool with much higher gas fees.
-> The Borrower's transaction gets delayed and executed at a much higher interest rate like 20 or 30%.
-> He has to pay much more than he saw and desired.

Worst case

-> In the worst case, the lender can change the interest so much high that the borrower appears to be liquidateable.
-> The lender liquidates the person.
-> This might not be a fair deal.

Impact

-> Loss of funds of users
-> Dopamine rush in lender's brain to do more : )

Tools Used

Manual review

Recommendations

There can be different approaches.

Approach 1

Implement some time delayed mechanism or 2 transactions with a gap of some time units to change critical parameters like interest rates for Lender.

Approach 2

Protocol should consider implementing some slippage protection like mechanism for interst rate.
Like say user specifies that he wants interest to be less than or equal to 5% and not more than that ( fail the transction in case >=5% )

Support

FAQs

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

Give us feedback!