Let’s say a malicious lender initiates a pretty standard pool where the interest rate is 10%, the auction length is 1 day, and other parameters such as maxLoanRatio all make sense.
An user might see that pool and decide to borrow from it. So that user initiates a transaction with the borrow() function in Lender.sol.
That transaction initiated by the user can be frontrunned by the lender of that pool, where the lender uses the setPool() function and updates their pool’s interest rate to be equal to the max interest rate and the auction length to be equal to 1 second, causing the user to take out a loan with different parameters than expected.
Below is a POC illustrating how the lender can re-set their pool parameters and the user has no say on what loan parameters they are expecting.
Scenario 1 - the borrower realizes their loan has the wrong parameters and immediately exit their position:
This could cause loss of trust on the protocol
Scenario 2 - the borrower does not realize the loan they received do not contain the expected parameters:
This could cause the borrower to keep borrowing at an unexpectedly high interest rate.
The malicious lender could start an auction that would only last 1 second. The lender could then use the seizeLoan() function in Lender.sol to claim the borrower’s collateral.
Manual Review & Foundry.
A possible solution to this could be to have one more parameter in the Borrow struct that is used as an input in the borrow() function. This parameter would represent what loan characteristics the borrower is expecting. That parameter could be a struct of Pool, or simply the expected interest rate and auction length. The code could then use those extra parameters to verify that the pool parameters the borrowers expect still equal the current parameters of the pool, and if it does then the protocol can continue to allow the borrowing to proceed, and if it does not the transaction would be reverted.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.