HardhatDeFi
15,000 USDC
View results
Submission Details
Severity: high
Invalid

Premature wToken Burning Leading to Irreversible Loss of Funds

Description:
In _redeemWTokenPrivate, wTokens are burned before withdrawing collateral from Aave. If the withdrawal fails (e.g., due to insufficient liquidity in Aave), users lose their wTokens without receiving the underlying collateral.

Root Cause:

  • Incorrect Order of Operations: The function burns wTokens (IWToken(_wToken).burn(...)) before executing IAave.withdraw(...).

  • Failure Handling: If Aave’s withdraw reverts (e.g., insufficient balance), the burned wTokens are permanently lost.

Impact:

  • Permanent Loss of User Funds: Users lose wTokens without retrieving collateral if the withdrawal fails (High Severity).

  • Violation of Atomicity: The operation is not atomic—partial execution leaves users with unrecoverable losses.

Recommendation:
Reverse the order: Withdraw collateral before burning wTokens:

function _redeemWTokenPrivate(...) private returns (uint256) {
// 1. Withdraw collateral first
uint256 _amountReturned = IAave(_aaveV3Pool).withdraw(...);
// 2. Burn wTokens only after successful withdrawal
IWToken(_wToken).burn(...);
return _amountReturned;
}
Updates

Lead Judging Commences

bube Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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