Lenders of the Beedle protocol can choose to start a refinancing auction, at the end of which, if nobody choose to buy the loan from them, they can seize the loan collateral from the borrower. The borrower always has the option to refinance his loan to a better offer, even during the live auction. This is normal and good. The issue is that the borrower is allowed to refinance and repay his loan even after an auction was finished, before the lender seized his rightfully earned collateral.
Lender can start an auction via Lender::startAuction which sets the auction start time:
After this point, a new lender may take up the loan by calling Lender::buyLoan but only during the auction period
When the auction is finished, the original lender can seize the collateral via Lender::seizeLoan
The issue lies with the ability for a borrower to refinance his loan even after the auction is done, as there are no checks in Lender::refinance with regards to auction logic and auction start time is reset, making Lender::seizeLoan revert
and the same with Lender::repay.
Lender loses his entitled collateral if the defaulter lender refinances his loan after an auction has expired, by front-running him.
Manual analysis and past contests trauma.
In Lender::refinance add a check similar to that of Lender::buyLoan, for each loan, that, if an auction was started, it now myst be ended.
Example implementation:
Add the same check in Lender::repay.
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.