M-16 MitigationConfirmed #111
Labels
confirmed for report
This issue is confirmed for report
mitigation-confirmed
MR-M-16
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
Vulnerability details
C4 Issue
M-16: distribute() Use the wrong end time to break maxSeniorRepayment's expectations
Comments
Original vulnerabilities/impacts:
The issue raises the case where
maxSeniorRepayment
set by tranches can be violated during the loan liquidation auction settlement flow, because the payment for senior tranches is calculated with inflated interests. Interests are calculated with block.timstamp instead of loan.endTime.Due to the bidding process, actual block.timestamp when a liquidation is settled will pass loan.endTime, this violates the check on
maxSeniorRepayment
of each tranche during loan initiation which uses loan.endTime.Mitigation
Fix: https://github.com/pixeldaogg/florida-contracts/pull/389/files
The mitigation is to use loan.endTime to calculate pending interests in distribute() flow:
(1) In distribute() flow,
uint256 pendingInterest
calculation is revised to use loan.endTime. This also correctsowedPerTranche[i]
andtotalPendingInterestOwed
;(2) In _handleTrancheExcess(), the tranche owed amount is also calculated using _loanEndTime.
The above corrects the calculation of pending interest and tranche owed amounts, which resolves the issue.
Test
The revised test is passing.
Conclusion
LGTM
The text was updated successfully, but these errors were encountered: