If attacker front-runs a user repayment tx with small amount of repay on behalf for him, it makes user repayment tx revert.
for understanding issue lets check _repay()
function first:
as we can see if amount
>debt
the function replaces the debt
value for actualRepayAmount
variable. means if user has 100e18
debt and gives 120e18
amount in input of repayment it only goes to repay just 100e18
, the actual debt.
the issue is when function burns the debt token, passes the amount
instead of actualRepayAmount
. this can lead to revert of repayment because if user has 100e18
debt token, the amount to burn cant be 120e18
because it exceeds the balance.
Attack Scenario:
Alice has 100e18
debt tokens.
Alice calls the repay()
function with 100e18
to repay her entire debt.
The attacker front-runs Alice's transaction by calling the repayOnBehalf()
function with Alice's address and 1e18
amount.
Now, Alice's debt is 99e18
, but she has provided 100e18
as input amount.
Alice's transaction will revert because _repay()
tries to burn 100e18
debt tokens while her balance is only 99e18
.
Attacker can do this to force user to be get liquidated.
Force liquidating a user.
Manual Review
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.