The _redeemWTokenPrivate function incorrectly assumes that _wTokenAmount directly corresponds to the withdrawable collateral in Aave. However, this assumption breaks in cases where:
Aave has insufficient liquidity (e.g., due to withdrawal restrictions or market conditions).
Rounding errors exist between aToken balances and wToken supply, leading to transaction failures.
This can cause funds to become stuck, preventing users from withdrawing collateral even if they hold wTokens.
Aave Liquidity Constraints
Aave does not guarantee immediate withdrawals if liquidity is low.
If insufficient liquidity exists, withdraw() fails and reverts, preventing users from redeeming wTokens.
Mismatch Between wTokens and aTokens
The contract assumes 1 wToken = 1 aToken worth of collateral.
However, due to interest accrual and rounding discrepancies, the actual redeemable amount can be lower.
This causes _withdraw() to revert if the requested amount exceeds available collateral.
A user holds wTokens and wants to redeem them for collateral.
They call _redeemWTokenPrivate(), which:
Burns wTokens.
Calls withdraw() on Aave.
Issue: If Aave has insufficient liquidity, the transaction fails and reverts.
Result:
User loses wTokens (already burned).
Collateral remains locked in Aave, making it impossible to withdraw.
❌ Users experience stuck funds, leading to financial losses.
❌ Protocol trust is damaged as users cannot withdraw expected funds.
A user accumulates yield over time, increasing their expected withdrawal amount.
Due to rounding discrepancies, the withdraw() function requests slightly more than available.
Aave reverts the transaction, even though the user should be able to withdraw.
Result:
User's withdrawal fails even though they have enough funds.
Funds appear stuck until a minor deposit or withdrawal updates the balance.
✅ User expects full withdrawal.
✅ If liquidity is low, _withdraw() will fail.
❌ Transaction reverts due to insufficient Aave liquidity.
❌ User loses ability to withdraw collateral.
Likelihood: ✅ High (Aave liquidity can fluctuate unexpectedly).
Impact: ✅ High (Users may be unable to withdraw funds).
❌ Users unable to access their funds if liquidity is low.
❌ Rounding errors cause unnecessary transaction failures.
❌ Protocol becomes unreliable, leading to loss of trust.
scaledBalanceOf and Liquidity Index for Accurate WithdrawalsInstead of assuming 1 wToken = 1 aToken, use Aave’s liquidity index to calculate the exact redeemable amount.
✅ Ensures withdrawal does not exceed available liquidity.
✅ Prevents wToken burns if Aave withdrawal fails.
✅ Avoids rounding errors by using liquidity index calculations.
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.