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
In repay method, the collateral to be released is calculated by a mathematical calculation with include division.
Vulnerability Detail
In EVM, as there are no Floating points, the decollateralized value will always take the floor value of the calculation ignore the latter part. If borrower is paying back in multiple transactions, he/she will loss some amount of collateral because of this.
Impact
Loss of Collateral for Borrower despite paying back the complete Loan Amount.
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
Breeje
medium
SOME AMOUNT OF COLLATERAL CAN BE STUCK IN ESCROW
Summary
In
repay
method, the collateral to be released is calculated by a mathematical calculation with include division.Vulnerability Detail
In EVM, as there are no Floating points, the
decollateralized
value will always take the floor value of the calculation ignore the latter part. If borrower is paying back in multiple transactions, he/she will loss some amount of collateral because of this.Impact
Loss of Collateral for Borrower despite paying back the complete Loan Amount.
Code Snippet
Link to Code
Tool used
Manual Review
Recommendation
When the repaid amount is equal to loan amount, transfer all the remaining collateral in the escrow to the Borrower.
Can use a new state variable to keep a track on this which will make sure that no amount of collateral is stuck inside escrow.
Duplicate of #263
The text was updated successfully, but these errors were encountered: