Due to incorrect calculations during the loan process, users can borrow more than their available collateral.
The code checks to ensure that collateralValue
is greater than or equal to a percentage of userTotalDebt
defined by the liquidationThreshold
.
The liquidationThreshold
is set to 80%, meaning it validates that the collateral is larger than 80% of the total debt.
For example, user A deposits 1 ETH as collateral and is allowed to borrow up to 1.2 ETH.
This means the user can borrow 20% more than the collateral value, and this could be exploited to steal all assets if abused.
The code should be modified as above to revert the transaction if the percentage of collateral is less than the loan amount.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.