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` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
repay business logic should handle the case if the repaid amount is greater than loan amount.
Summary
In cooler contract, there is a business logic implemented where the borrower or anyone can repay the loan either partically or fully.
but in one scenario, the repaid amount can be greater then the loan amount. in this case, the contract reverts which would be a loss to imo. The borrower can change the mind and come back to repay again which could not be sure if they change their mindset.
in above if statement if (repaid == loan.amount) if the repaid > loan.amount, then the else part is executed where the transaction will revert due to underflow.
Impact
Repayment could be postponed or skipped if the borrower change their mindset.
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
ak1
medium
repay business logic should handle the case if the repaid amount is greater than loan amount.
Summary
In cooler contract, there is a business logic implemented where the borrower or anyone can repay the loan either partically or fully.
but in one scenario, the repaid amount can be greater then the loan amount. in this case, the contract reverts which would be a loss to imo. The borrower can change the mind and come back to repay again which could not be sure if they change their mindset.
Vulnerability Detail
in above if statement
if (repaid == loan.amount)
if the repaid > loan.amount, then the else part is executed where the transaction will revert due to underflow.Impact
Repayment could be postponed or skipped if the borrower change their mindset.
Code Snippet
https://github.com/sherlock-audit/2023-01-cooler/blob/main/src/Cooler.sol#L108-L124
Tool used
Manual Review
Recommendation
Update the logic as shown below.
Duplicate of #218
The text was updated successfully, but these errors were encountered: