Submitted by Ruhum, also found by IllIllI, WatchPug, BowTiedWardens, gzeon, plotchy, and scaraven
https://github.com/code-423n4/2022-04-abranft/blob/main/contracts/NFTPairWithOracle.sol#L198-L223
https://github.com/code-423n4/2022-04-abranft/blob/main/contracts/NFTPairWithOracle.sol#L200-L212
https://github.com/code-423n4/2022-04-abranft/blob/main/contracts/NFTPairWithOracle.sol#L288
The lender should only be able to seize the collateral if:
But, the lender is able to seize the collateral at any time by modifying the loan parameters.
The updateLoanParams() allows the lender to modify the parameters of an active loan in favor of the borrower. But, by setting the ltvBPS value to 0 they are able to seize the collateral.
If ltvBPS is 0 the following require statement in removeCollateral() will always be true:
https://github.com/code-423n4/2022-04-abranft/blob/main/contracts/NFTPairWithOracle.sol#L288
rate * 0 / BPS < amount is always true.
That allows the lender to seize the collateral although its value didnt decrease nor did the time to repay the loan come.
So the required steps are:
Dont allow updateLoanParams() to change the ltvBPS value.
cryptolyndon (AbraNFT) confirmed and commented:
