The liquidation process in the RAAC protocol allows premature finalization without verifying complete debt repayment, leaving borrowers' NFT collateral transferred while debt remains outstanding.
The StabilityPool can trigger finalization before fully repaying the borrower's debt, breaking the protocol's liquidation invariants.
The issue is the ordering of operations. NFT transfers and state updates occur before confirming successful debt repayment, which could leave the system in an inconsistent state if the transfer fails.
Picture this attack. A liquidation begins when a borrower's position becomes unhealthy. The StabilityPool initiates liquidation but can call finalize before completing debt repayment. The LendingPool transfers the NFT collateral while debt remains, creating an inconsistent state.
Think of the liquidation process like a three-step dance between the LendingPool and StabilityPool. When a borrower's position becomes unhealthy, the protocol should gracefully transfer their NFT collateral while clearing their debt. However, there's a critical misstep in this choreography.
The story begins when the LendingPool marks a borrower for liquidation. Their prized NFT collateral, perhaps representing a valuable real estate asset stands ready for transfer. The StabilityPool steps in to handle the debt repayment, but here's where things get interesting.
Just like a bank must ensure a check has cleared before releasing assets, the protocol should verify debt clearance before transferring NFT collateral. Instead, the finalizeLiquidation()
function in LendingPool.sol eagerly releases the NFT:
This creates a race condition where the StabilityPool could fail to fully repay the debt after receiving the collateral. The exact impact? A borrower with $100,000 in debt could lose their $150,000 NFT collateral while still owing $50,000 to the protocol.
The liquidation process could leave borrowers with residual debt while transferring their NFT collateral, creating an inconsistent state.
This implementation ensures atomic execution by:
Validating initial state
Transferring debt coverage first
Burning debt tokens
Transferring NFT collateral only after debt clearance
Updating liquidation state last
The ordering guarantees that collateral transfer only happens after successful debt resolution.
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.