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.
simon135 - Since when a loan is cleared rollable=true an attacker can do many diffrent thinks with that like rolling over loan with frontrunning and getting more debt with out paying collateral
#312
Closed
github-actionsbot opened this issue
Jan 27, 2023
· 0 comments
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
Since when a loan is cleared rollable=true an attacker can do many diffrent thinks with that like rolling over loan with frontrunning and getting more debt with out paying collateral
Summary
Since when clearing a loan, rollable by default=true.By doing that, when clearing a loan, a user/borrower/attacker can come and do many options like roll off a loan for free/ bypass the clearinghouse duration for the loan.
Vulnerability Detail
case 1:
lender and borrower match a loan and right after the clear tx The borrower rolls over the loan with back running and gets more debt without spending collateral
it results: huge debt on the loan for free(on Hugh loan this is big loss)
ex:
lender calls clear
borrower front-runs the lender's call to toggle the roll off with the higher gas fee and gets more debt without paying collateral because nothing has happened with the loan yet. They can loop in the roll function with high gas fees getting unlimited debt for free.
case 2:
the same thing as above but instead of the borrower it's a random user and since when newcollateral=0 the user can inflict debt on the borrower and cause a huge debt ceiling.
case 3:
the borrower clears the loan in the auction house and they have a limit of 365 days but since we can roll over with the lender approving it we can bypass the limit on the duration of the loan.
when newCollateral=0 which is true for the examples above because the collateral and new collateral are calculated the same way and one of the only ways to make newCollateral>0 we would have to repay some of the loans but we are not doing that and we are just getting the newcollateral - collateral and since they updated every time it should be zero.
ex: colateral=100 newcollateral= 100=0
and since we increment by 5 every time the collateral=105
and newcollateral=105=0
I put them in the same issue because the underlying issue is the same on default rollable=true
some suggestions for some of the mitigation if rollable !=false on the clearing of the loan
roll makes onlyowner so nobody can have changed to make more debt for the owner The overall fix
make rollable=false on the clearing of a loan
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
simon135
high
Since when a loan is cleared rollable=true an attacker can do many diffrent thinks with that like rolling over loan with frontrunning and getting more debt with out paying collateral
Summary
Since when clearing a loan, rollable by default=true.By doing that, when clearing a loan, a user/borrower/attacker can come and do many options like roll off a loan for free/ bypass the clearinghouse duration for the loan.
Vulnerability Detail
case 1:
lender and borrower match a loan and right after the clear tx The borrower rolls over the loan with back running and gets more debt without spending collateral
it results: huge debt on the loan for free(on Hugh loan this is big loss)
ex:
case 2:
the same thing as above but instead of the borrower it's a random user and since when
newcollateral=0
the user can inflict debt on the borrower and cause a huge debt ceiling.case 3:
the borrower clears the loan in the auction house and they have a limit of 365 days but since we can roll over with the lender approving it we can bypass the limit on the duration of the loan.
Code Snippet
on default loan is rollable
when
newCollateral=0
which is true for the examples above because the collateral and new collateral are calculated the same way and one of the only ways to makenewCollateral>0
we would have to repay some of the loans but we are not doing that and we are just getting the newcollateral - collateral and since they updated every time it should be zero.ex:
colateral=100
newcollateral= 100
=0and since we increment by 5 every time the
collateral=105
and
newcollateral=105
=0Tool used
Manual Review
Recommendation
I put them in the same issue because the underlying issue is the same on default
rollable=true
some suggestions for some of the mitigation if
rollable !=false
on the clearing of the loanThe overall fix
make rollable=false on the clearing of a loan
Duplicate of #215
The text was updated successfully, but these errors were encountered: