Open code423n4 opened 1 year ago
@SantiagoGregory
The scenario is correct but I don't think it is of high severity at first sight, considering setting liquidationInitialAsk
too low only exposes the lender to a potential bad debt if the dutch auction settles below its debt
However, it seems from this and other findings that leaving the liquidationInitialAsk
at the lien
level has multiple unintended side effects.
SantiagoGregory marked the issue as sponsor confirmed
Picodes marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/LienToken.sol#L471-L489 https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/LienToken.sol#L153-L174
Vulnerability details
Impact
When a new lien is taken (or bought out), one of the validations is to ensure that the
potentialDebt
of each borrower on the stack is less than or equal to theirliquidationInitialAsk
.In
_appendStack()
and_buyoutLien()
, this is performed by iterating through the stack backwards, totaling up thepotentialDebt
, and comparing it to each lien'sliquidationInitialAsk
:However, only the first item on the stack has a
liquidationInitialAsk
that matters. When a new auction is started on Seaport,Router#liquidate()
usesstack[0].lien.details.liquidationInitialAsk
as the starting price. The other values are meaningless, except in their ability to DOS future borrowers.Proof of Concept
liquidationInitialAsk
to be exactly the value of my loanliquidationInitialAsk
is recordedfutureBorrow + myBorrow <= myLiquidationInitialAsk
, which is not possible for anyfutureBorrow > 0
This is made worse by the fact that
liquidationInitialAsk
is not a variable that can justify a refinance, so they'll need to either pay back the loan or find a refinancier who will beat one of the other terms (rate or duration) in order to get rid of this burden.Tools Used
Manual Review
Recommended Mitigation Steps
Get rid of all checks on
liquidationInitialAsk
except for comparing the total potential debt of the entire stack to theliquidationInitialAsk
of the lien at position 0.