The LendingPool contract's setParameter function allows the owner to set the liquidationThreshold
without enforcing a minimum value. If the admin sets the liquidationThreshold
too low (e.g., below 80_00 or even 0), the liquidation condition may be triggered for all users—even those with healthy collateral—resulting in mass liquidations and significant user losses.
The vulnerability stems from the fact that the setParameter
function only checks that the newValue
does not exceed 100_00
but does not enforce a lower bound. Without a lower bound, an Owner might set the liquidationThreshold
to an unsafe value—such as 0 or any value below a safe minimum (for example, below 80_00
). This unsafe setting could cause the collateral condition to be unrealistic.
Consider this snippet of the setParameter
function:
Effect on Collateral Calculation:
Without a lower bound, an overly low liquidationThreshold
can cause the computation of the collateral threshold to become unrealistic. In the calculateHealthFactor
function, the collateral threshold is calculated:
When liquidationThreshold
is set too low, collateralThreshold
becomes so low that almost any debt will make the computed health factor fall below the required threshold. As a result, users could be incorrectly flagged for liquidation.
Initiating Liquidation:
The initiateLiquidation
function triggers liquidation when the calculated health factor is below a certain threshold:
With a too-low threshold, even users with reasonable collateral may end up being put under liquidation.
Closing Liquidation:
After initiating liquidation, if the admin resets the liquidationThreshold
back to a normal value, users have a grace period (defined by liquidationGracePeriod
) to call closeLiquidation
and resolve their liquidation status. However, the function requires that a user's debt is reduced such that:
This situation creates a potential problem: even during the grace period, if the user's debt (userDebt
) remains above the DUST_THRESHOLD
, the liquidation cannot be closed. This may leave users in a perpetual liquidation state, even if the administration corrects the threshold after initiating liquidation.
Setting the liquidationThreshold too low can trigger unintended liquidations across the platform, causing severe losses for users.
Manual Review
Implement a lower bound check in the setParameter
function to ensure that the liquidationThreshold remains within a safe range. For example, enforce that the newValue is not lower than 80_00 (or another protocol-determined minimum):
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.