Closed c4-bot-3 closed 7 months ago
0xA5DF marked the issue as primary issue
We should get rid of this one. This was left as legacy (only improving apr matters).
Thanks, it indeed seems from the code that those checks were supposed to run, therefore this is a valid issue. However, regarding severity - I fail to see why this is a significant issue - how does this impact the borrower or other users?
Marking as low for now
0xA5DF changed the severity to QA (Quality Assurance)
No impact on borrower/lender
Moving to #70
0xA5DF marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/loans/MultiSourceLoan.sol#L835-L846
Vulnerability details
Impact
The
ImprovementMinimum
defines the minimum improvement (in BPS) required for a strict improvement when users refinance an existing loan.At deployment, its value is set as
The code snippets above demonstrate that three improvements are required when users refinance: principal amount, interest, and loan duration. However, the function
_checkStrictlyBetter()
currently checks only the APR (interest) in_checkTrancheStrictly()
. The otherprincipalAmount
andendTime
are checked to be larger than the previous values but not checked for minimum improvement in the function_checkStrictlyBetter()
.Proof of Concept
As you can see, the
_checkTrancheStrictly()
checks the APR to be improved by__minimum.interest
. However, the duration is only checked to be_offerEndTime < _loanEndTime
in_checkStrictlyBetter()
.Tools Used
Manual Review
Recommended Mitigation Steps
Add check to ensure the required minimum improvement when users refinance a loan.
Assessed type
Invalid Validation