Core Contracts

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

Race Condition Between Repayment and Liquidation Closure

Summary

The LiquidityPool::closeLiquidation function allows a user to exit liquidation only if their debt has been fully repaid within the grace period. However, a race condition exists:

  • A user repays their debt in one transaction.

  • Then, they attempt to close liquidation in a separate transaction.

  • If the block timestamp increases beyond the grace period in between, the second transaction fails.

Vulnerability Details

If a user repays their debt just before the grace period expires, they might not have enough time to execute closeLiquidation before the deadline.

Impact

Unrecoverable liquidation: Users could lose their collateral even after full repayment.

Tools Used

Mnual review

Recommendations

Merge repayment and liquidation closure into a single function

Updates

Lead Judging Commences

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

A borrower can LendingPool::repay to avoid liquidation but might not be able to call LendingPool::closeLiquidation successfully due to grace period check, loses both funds and collateral

Support

FAQs

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