A critical vulnerability exists in the interaction between StabilityPool
and LendingPool
contracts where emergency shutdown states can become desynchronized, leading to stuck funds and NFTs. This occurs because each contract implements its own independent pause mechanism without cross-contract state synchronization.
Affected Contracts & Functions:
StabilityPool.sol:
LendingPool.sol:
Manual Code Review
Hardhat Testing Framework
Ethers.js
Slither Static Analysis
This proof of concept demonstrates a critical vulnerability in the interaction between StabilityPool and LendingPool contracts where their emergency shutdown mechanisms can become desynchronized. The vulnerability allows funds and NFTs to become trapped due to misaligned pause states between the two contracts.
SCENARIO WALKTHROUGH:
Initial Setup Phase:
A borrower deposits an NFT as collateral in LendingPool
Borrower takes out a loan against this collateral
System is in normal operating state with both pools active
Attack Prerequisites:
Access to protocol owner account to trigger pause
Active loan position with NFT collateral
Liquidatable position
Attack Execution Flow:
Attacker identifies a liquidatable position
Protocol owner/admin pauses only the LendingPool
StabilityPool remains active and unpaused
Liquidation is attempted through StabilityPool
Transaction reverts during NFT transfer due to LendingPool pause
Results in stuck NFTs and incomplete liquidation
Expected Outcomes:
NFT remains locked in LendingPool
Debt position remains unchanged
Liquidation process cannot be completed
No mechanism exists to recover from this state
System enters an irrecoverable state requiring manual intervention
Why This Works:
No synchronization between pause states
Missing cross-contract state validation
Lack of atomic execution in liquidation process
No rollback mechanism for failed liquidations
Incomplete emergency shutdown coordination
Impact:
Users' NFTs become permanently locked
Debt positions cannot be liquidated
Protocol's liquidation mechanism breaks
Requires emergency intervention to resolve
Loss of user assets and protocol functionality
The following PoC code demonstrates this vulnerability through a series of
contract interactions that simulate the described attack scenario.
The vulnerability can lead to:
Locked Funds: Funds in StabilityPool become locked when attempting liquidations
Stuck NFTs: Collateral NFTs remain locked in LendingPool
State Inconsistency: Protocol state becomes inconsistent between contracts
Failed Liquidations: Liquidation mechanisms break down
Protocol Instability: Emergency shutdown becomes unreliable
Implement a centralized emergency controller:
Add cross-contract state checks:
Implement safe liquidation rollback:
Likelihood: High
Easy to trigger through normal contract interactions
No existing safeguards
Complex cross-contract dependencies
Impact: High
Direct loss of user funds
Protocol state corruption
Broken core functionality
Complexity: High
Involves multiple contract interactions
Requires understanding of pause mechanics
Cross-contract state management
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.