Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Valid

User will be unfairly liquidated because no HF check while finalizing liquidation

Summary

We check user's HF while liquidation call and start liquidation procces if under treshold. User suppose to be liquidated if he didn't repay his debt at the grace perioud after initiating liquidation proccess. The problem is, while finalisation of liquidation we don't check a HF again. If collateral value increased while liquidation and we below treshold liquidation will occur anyway.

Vulnerability Details

LendingPool.sol finalizeLiquidation() do not check for HF before liquidation. Like initiateLiquidation() do

uint256 healthFactor = calculateHealthFactor(userAddress);
if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorTooLow();



Since grace period to react on liquidation will likely defined as 3 days there is a chance value of the property would increase while this perioud and user will be liquidated unfairly.
There is a second option, since user can deposit NFT while liquidation proccess his HF should also be increased, it proves my statement about unfair liquidation.

Impact

unfair liquidation of the user

Tools Used

manual review

Recommendations

add such lines to lendingPool.sol finalizeLiquidation()

uint256 healthFactor = calculateHealthFactor(userAddress);
if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorTooLow();
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

LendingPool::finalizeLiquidation() never checks if debt is still unhealthy

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!