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 May 26, 2023. It is now read-only.
github-actionsbot opened this issue
Jan 27, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
Cooler: roll function should set loan.rollable to false when called
Summary
The Cooler.roll function allows the borrower of a loan to extend the loan for another duration.
By doing this the debt is increased and the borrower must provide additional collateral.
The issue with this is that the borrower can extend the loan for as many durations as he wants.
The rollable attribute is not set to false when the function is called.
Vulnerability Detail
The lender might grant the borrower a loan with a 3% interest rate which can be a reasonable interest rate for a loan with a duration of one year.
However the borrower can roll the loan for as many durations as he wants.
This is a problem since the economic incentives are such that longer loan durations should require the borrower to pay higher interest rates. This is because the lender loses access to his money for a longer period of time and the longer the duration the higher the risk of default.
The borrower should not have to pay only 3% interest per year for a loan with duration of say 10 years. The interest rate should be a lot higher.
Impact
So the borrower can extend a loan which is meant for a short duration for as long as he wants with the low interest rates that are only sensible for the shorter duration.
The Cooler.roll function should set rollable to false such that the borrower can only extend the loan for one additional period. If he wants to extend the loan for longer, the lender must consent to this again.
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` labelHighA valid High severity issueRewardA payout will be made for this issue
HollaDieWaldfee
medium
Cooler: roll function should set
loan.rollable
tofalse
when calledSummary
The
Cooler.roll
function allows the borrower of a loan to extend the loan for another duration.By doing this the debt is increased and the borrower must provide additional collateral.
The issue with this is that the borrower can extend the loan for as many durations as he wants.
The
rollable
attribute is not set tofalse
when the function is called.Vulnerability Detail
The lender might grant the borrower a loan with a 3% interest rate which can be a reasonable interest rate for a loan with a duration of one year.
However the borrower can roll the loan for as many durations as he wants.
This is a problem since the economic incentives are such that longer loan durations should require the borrower to pay higher interest rates. This is because the lender loses access to his money for a longer period of time and the longer the duration the higher the risk of default.
The borrower should not have to pay only 3% interest per year for a loan with duration of say 10 years. The interest rate should be a lot higher.
Impact
So the borrower can extend a loan which is meant for a short duration for as long as he wants with the low interest rates that are only sensible for the shorter duration.
Code Snippet
https://github.com/sherlock-audit/2023-01-cooler/blob/main/src/Cooler.sol#L129-L147
Tool used
Manual Review
Recommendation
The
Cooler.roll
function should setrollable
tofalse
such that the borrower can only extend the loan for one additional period. If he wants to extend the loan for longer, the lender must consent to this again.Fix:
Duplicate of #215
The text was updated successfully, but these errors were encountered: