The partialRepay() function may not be usable in some cases #1171
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-1182
grade-c
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L523-L531
Vulnerability details
Impact
When partially paying the debt, the repayment percent amount needs to be greater than minPartialRepayPercent and the remaining debt needs to be greater than the minBorrow amount.
The minimum repayment percentage may result in a remaining debt lower than the minimum borrowing amount, leading to a revert. The partialRepay() function may not always be available, preventing users from repaying their debts in dire situations which can result in liquidation.
Proof of Concept
POC:
LendingTerm.t.sol
Tools Used
Manual Review
Recommended Mitigation Steps
Delete the minPartialRepayPercent check inside the _partialRepay() function.
Assessed type
Other
The text was updated successfully, but these errors were encountered: