Frontrunning of refinance and borrow function can make the borrower to pay a higher interest rate.
Alice refinance her loan in Bob's pool. Bob monitors the mempool and sees that Alice will refinance loan in its pool and frontruns it by calling updateInterestRate function to significantly increase the interest rate of the pool. After Alice's refinance is executed, Bob's manipulated interest rate is used to update the interest rate of Alice's loan.
https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Lender.sol#L591-L710
https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Lender.sol#L232C1-L287
https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Lender.sol#L221-L226
Manual Review
Add interestRate in Borrow and Refinance structs and if check in the functions
if (pool.interestRate >= borrows[i].interestRate) revert Error();
if( pool.interestRate >= refinances[i].interestRate) revert Error();
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.