You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
Borrower can escape paying last payment cycle interest
Summary
If a borrower is on their second to last payment cycle and does not pay by the paymentDueBy, the borrower will be on their last payment cycle. When the borrower then calls OCC_Modular.callLoan(), the borrower will pay the late fee and the interest for the second-to-last payment cycle. This allows the borrower to avoid having to pay the last payment cycle interest.
Vulnerability Detail
When amountOwed() is called, the late fee is calculated as the interest owed for a single payment cycle:
Let's assume a borrower is on the second to last payment cycle. Let's consider the scenario:
Borrower is on the second to last payment cycle.
Borrower does not pay payment on time. Borrower begins to incur late fees. The borrower is now on their last payment cycle.
Borrower calls OCC_Modular.callLoan(). The following occurs:
Borrower's interestOwed will equal the interest owed for a single payment cycle. This is calculated from amountOwed().
Borrower's lateFee will be above 0. This is calculated from amountOwed().
Loan is paid off.
In the scenario above, the borrower pays for the interestOwed from the second-to-last payment cycle and the late fee. The problem here is that the borrower should also pay the interest for the last payment cycle, since they are currently on the last payment cycle. By calling OCC_Modular.callLoan(), the borrower avoids paying this last payment cycle.
Impact
Borrower avoids having to pay the last interest payment cycle when calling OCC_Modular.callLoan().
1 comment(s) were left on this issue during the judging contest.
panprog commented:
medium, dup of #97, if there are more than 1 interest payments missed by borrower, then callLoan takes only 1 period payment, allowing borrower to skip paying the other periods interest and lateFee payments.
sherlock-admin2
changed the title
Savory Coconut Condor - Borrower can escape paying last payment cycle interest
thank_you - Borrower can escape paying last payment cycle interest
May 11, 2024
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
thank_you
medium
Borrower can escape paying last payment cycle interest
Summary
If a borrower is on their second to last payment cycle and does not pay by the paymentDueBy, the borrower will be on their last payment cycle. When the borrower then calls OCC_Modular.callLoan(), the borrower will pay the late fee and the interest for the second-to-last payment cycle. This allows the borrower to avoid having to pay the last payment cycle interest.
Vulnerability Detail
When amountOwed() is called, the late fee is calculated as the interest owed for a single payment cycle:
Let's assume a borrower is on the second to last payment cycle. Let's consider the scenario:
amountOwed()
.amountOwed()
.In the scenario above, the borrower pays for the interestOwed from the second-to-last payment cycle and the late fee. The problem here is that the borrower should also pay the interest for the last payment cycle, since they are currently on the last payment cycle. By calling OCC_Modular.callLoan(), the borrower avoids paying this last payment cycle.
Impact
Borrower avoids having to pay the last interest payment cycle when calling OCC_Modular.callLoan().
Code Snippet
https://github.com/sherlock-audit/2024-03-zivoe/blob/d4111645b19a1ad3ccc899bea073b6f19be04ccd/zivoe-core-foundry/src/lockers/OCC/OCC_Modular.sol?plain=1#L492-L518
https://github.com/sherlock-audit/2024-03-zivoe/blob/d4111645b19a1ad3ccc899bea073b6f19be04ccd/zivoe-core-foundry/src/lockers/OCC/OCC_Modular.sol?plain=1#L440-L457
Tool used
Manual Review
Recommendation
When OCC_Modular.callLoan() is called, Zivoe should require the borrower to pay the last payment cycle's interest payment.
Duplicate of #97
The text was updated successfully, but these errors were encountered: