The closeLiquidation function in the LendingPool contract currently allows a user to close their liquidation status without enforcing any repayment of their outstanding debt. The relevant code snippet is as follows:
Issues Identified
No Debt Repayment Requirement: The function allows users to close their liquidation status without any requirement to repay their outstanding debt.
Potential Exploitation: Users could exploit this functionality to avoid repaying their debts, leading to financial instability for the protocol. (until the userDebt > DUST_THRESHOLD)
Protocol Integrity at Risk: The lack of enforcement for debt repayment undermines the integrity of the lending protocol, potentially leading to systemic risks.
The current implementation of the closeLiquidation function allows users to close their liquidation status without repaying their debts, which can lead to:
Financial losses for the protocol and its users.
Erosion of trust in the lending system.
Potential exploitation by users to escape their debt obligations.
1.Implement a Debt Repayment Requirement : Modify the closeLiquidation function to require users to repay their debts before they can close their liquidation status. This can be done by adding a parameter for the repayment amount and validating it against the user's outstanding debt.
Example Code Update
Here’s a suggested modification to the closeLiquidation function:
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.