Vulnerability Details
The StabilityPool is exposed to potentially unlimited losses due to a combination of uncapped debt growth and forced absorption of underwater positions during liquidations. This vulnerability stems from the interaction between DebtToken's compound interest mechanism and the StabilityPool's liquidation responsibilities.
The DebtToken contract implements automatic debt scaling through its balance calculation:
Durning liquidations, the stability pool must cover the entire scaled debt amount
The liquidation mechanism includes a grace period during which debt continues to compound:
This creates a feedback loop where:
DebtToken's balance grows exponentially through compound interest (up to 400% APR)
The grace period allows additional debt accumulation before liquidation
The StabilityPool must absorb the full debt regardless of collateral value
High interest rates combined with falling collateral values can create severe losses
Impact
StabilityPool depositors face unlimited downside risk
Single toxic position can drain significant pool liquidity
System vulnerable to malicious debt accumulation
Risk of cascading liquidations during market stress
Potential for complete protocol insolvency
A coded function in the LendingPool.test
the Console logs shows
Initial debt amplification:
We borrowed only 30 USDC
But immediately the debt grew to ~110 USDC (Initial Debt: 110.000000218797564727)
This suggests there are significant fees or interest charges applied at the time of borrowing
Collateral value vs Debt disparity:
Final collateral value: 5 USDC
Total stability pool loss: ~110 USDC
This means the stability pool takes a loss of ~105 USDC that cannot be recovered
Health Factor behavior:
Initial Health Factor: ~0.73 (already below 1.0)
After price drop: ~0.036 (significantly impaired)
This drop in health factor triggers liquidation
The key vulnerability is that there's no mechanism to prevent or mitigate situations where:
The debt grows significantly larger than the initial borrow amount
The collateral value drops far below the outstanding debt
The stability pool has to absorb the full difference with no recourse
Cap debt growth during the grace period by modifying DebtToken.sol
Implement a "circuit breaker" in StabilityPool.sol that can pause new deposits if loss rates exceed sustainable levels.
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.