By calling the borrow()
method, the user can borrow funds from a specified pool. However, the terms of the loans from that pool, such as auctionLength
and interestRate
, can be modified between the moment when the user sends the transaction and when the loan actually gets created. This can effectively give the malicious lender the opportunity to claim the collateral without a valid auction.
Please consider the following scenario:
Alice creates a pool of USDC/WETH in the protocol, setting the maxLoanRatio
to 15 * 1e12
, meaning for each borrowed WETH she expects a collateral of at least 4_000 USDC. She also sets auctionLength
to 1 day.
Bob sees Alice's pool, finds the terms favorable and decides to borrow 10 WETH from it, providing 40_000 USDC as a collateral. Assuming the price of WETH = 2_000 USDC, the loan will be 100% overcollateralized. It would be beneficial for Alice to claim the collateral without putting the loan to an auction.
Alice sees the Bob's transaction in the mempool and frontruns it with calling setPool()
method, overriding the auctionLength
of her pool to 1 second.
Alice puts the loan at an auction. Given that the auction time is one second, it will expire before anyone would be able to buy it (it's almost impossible for someone to buy the loan from an auction in the same block as the auction started, this will require backrunning and accepting the 0 interestRate
).
After 1 block Alice calls seizeLoan()
, effectively claiming Bob's collateral.
The exact same scenario may also happen if Bob tries to refinance his loan to Alice's pool by calling refinance()
method.
Borrower's collateral may be stolen by the lender or the borrower may be forced into a loan with conditions they have not agreed upon.
Manual Review
Add the critical loan's parameters, such as auctionLength
and interestRate
, to the Borrow
struct, so that the borrower specifies the conditions they agree to and the borrowing can't be frontrun.
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.