Partial payment can't be made if a user borrows exactly minBorrow
or a little bit above minBorrow
#403
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-1182
edited-by-warden
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#L527-L532
Vulnerability details
Some
lendingTerm
requires a user to make partial payment by payingminPartialRepayPercent
which might vary across terms. The borrowed Amount is deducted from the issuance and verified if greater thanminBorrow
, this condition will result in some users not being able to pay back the loan partially is the newborrowAmount
is less than or equal tominBorrow
Impact
User will not be able to pay the partial payment if the
borrowAmount
isn't significantly get than theminBorrow
Proof of Concept
When the borrower creates the debt the
borrowAmount
is checked if greater than or equal to theminBorrow
in this case a user can borrow exactly theminBorrow
amount .However during
partialRepay
theborrowAmount
after a user pays part is verified to be greater thanminBorrow
Making the repayment an issue for borrowers who borrowed little and potential issues for other huge borrowers who are required to pay partially in the long run.
Tools Used
Manual Review
Recommended Mitigation Steps
Change the
>
in the requt statement fo>=
this will allow the users pay partially while theminBorrow
is till pegged.Assessed type
Context
The text was updated successfully, but these errors were encountered: