No liquidation mechanism is present for non-periodic payment loans. #1174
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-1057
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L652-L656
Vulnerability details
Impact
Liquidations are an important mechanism to keep a lending platform solvent. This platform enables liquidations using an auction mechanism to ensure best prices for defaulted accounts. This is handled via the
call
function inLendingTerm.sol
contract which checks if the loan is indeed able to be auctioned off in the following snippet.The issue is that the
partialRepayDelayPassed
always returns false for non-periodic payment loans. The system tracks the valuemaxDelayBetweenPartialRepay
which ensures regular payments are made. The system also shows intention of supporting loans which dont have periodic payments, by setting this value to 0 as described in the comments.The issue is that if
maxDelayPartialRepay
is set to 0, thepartialRepayDelayPassed
function will always return false as seen in the following snippet.So the only way to liquidate loans without payment plans is to deprecate the entire gauge. This is not ideal as it would liquidate all loans in the gauge. This is a design issue that can lead to insolvency of the protocol.
Proof of Concept
This is a design issue and basically has missing code to handle loans which the documentation in the code claims to support. No POC is provided since the functionality is entirely missing.
Tools Used
Manual review
Recommended Mitigation Steps
Implement a due date mechanism for loans without payment plans. If the due date passes, the loan will be eligible for liquidation.
Assessed type
Other
The text was updated successfully, but these errors were encountered: