During the Lender.buyLoan()
function, the buyer has the ability to purchase the loan in a pool that has been created with fake tokens (other than loan and collateral tokens). This vulnerability could potentially allow malicious actors to manipulate the system and cause harm to the lending platform, resulting in a DOS attack.
During a Dutch auction, a new lender can purchase a loan from an old lender by using the Lender.buyLoan()
function. This adds the loan to their own pool with a new interest rate that is less than the currentAuctionRate. However, the new pool created may contain tokens other than the loan.loanToken
and loan.collateralToken
. This presents a risk, as a new lender may buy the loan with fake tokens that are not actually deposited into the poolId, causing an imbalance in the tokens. This can lead to issues later on when the borrower wants to repay the loan. Inside the repay()
function, the pool is calculated using the new lender address, old loan, and collateral token address. If there is no such combination of poolId, the system will face a DOS attack resulting in the loss of borrower collateral as he will never be able to get back his collateral using repay()
.
There is no direct benefit for attacked doing this attack so likelihood of this happening is less therefore this is marked as a medium issue.
If a new lender creates a pool with fake tokens and purchases an original loan using those tokens, it can cause a Denial of Service (DOS) attack, which can result in the borrower losing all of their collateral.
manual review
To mitigate this issue we can add two missing checks in the buyLoan function
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.