Partial Repayment Issue for Loans at Minimum Borrow Threshold in LendingTerm Contract #334
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/volt-protocol/ethereum-credit-guild/blob/4d33abf95fee69391af0652e3cbe5e0cffa25f9f/src/loan/LendingTerm.sol#L528
https://github.com/volt-protocol/ethereum-credit-guild/blob/4d33abf95fee69391af0652e3cbe5e0cffa25f9f/src/loan/LendingTerm.sol#L529
Vulnerability details
Impact
The protocol allows partial repayments of debt on all open loans which has option to repay debt partially.
The feature of partial repayments is important because for correlated assets loan with interest building up may become insolvent. Since this issue do not allow borrowers with minimum borrow amount, to repay debt partially. Borrowers position may go underwater due to interest building up and bad debt may occur.
Proof of Code
Add the following test to the LendingTerm.t.sol
require( borrowAmount - issuanceDecrease > ProfitManager(refs.profitManager).minBorrow(), "LendingTerm: below min borrow" );
condition will never be passed for the loan with minimum borrow amount.Output for testPartialRepaySuccessForMinBorrow :
Tools Used
Manual Review, Foundry
Recommended Mitigation Steps
Assessed type
Other
The text was updated successfully, but these errors were encountered: