This repository has been archived by the owner on May 26, 2023. It is now read-only.
yixxas - Terms for expiry date for loans can be bypassed #73
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Escalation Resolved
This issue's escalations have been approved/rejected
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
yixxas
high
Terms for expiry date for loans can be bypassed
Summary
Lenders and borrowers come to an agreement via the contract based on the terms provided in a
Request
. The decided expiry date can unilaterally be extended by the borrower without any input from the lender.Vulnerability Detail
The key issue here is that the default state of
rollable
is set to true when a lender clears a loan. A loan that has been newly cleared can always be rolled. The borrower can always frontrun thetoggleRoll()
transaction and extend the expiry date of the loan regardless of whether lender agrees to it. In fact, borrower can make multiple transactions ofroll()
beforetoggleRoll()
is called to extend the expiry date multiple times.Impact
Impact is severe here because lender essentially does not have a choice for the expriy date of a loan. The agreed upon expiry date can be extended even if they do not want to allow it. Borrower can choose to extend the expiry date to its own preference.
For example, Borrower and Lender agrees on a loan of
1 years
. Right after Lender clears the loan, Borrower callstoggleRoll()
10 times, put in the required collateral to cover the interest and extend it by10 years
. Lender is now forced to give a loan of10 years
even though theytoggleRoll()
.Code Snippet
https://github.com/sherlock-audit/2023-01-cooler/blob/main/src/Cooler.sol#L139
https://github.com/sherlock-audit/2023-01-cooler/blob/main/src/Cooler.sol#L177
Tool used
Manual Review
Recommendation
It is recommended that we set the default state of whether a loan is
rollable
to false when a loan is cleared by Lender.Duplicate of #265
The text was updated successfully, but these errors were encountered: