The redeemWToken function allows users to convert their wTokens back into collateral tokens by withdrawing the underlying assets from Aave V3. However, if the collateral token associated with the wToken is not supported by Aave V3, the function will fail, leaving users unable to retrieve their funds. This vulnerability arises because the contract does not validate whether the collateral token is still supported by Aave V3 before executing the withdrawal. As a result, users who own wTokens may lose access to their collateral tokens, leading to financial losses and reputational damage for the protocol.
Users who hold position tokens (long or short tokens) can interact directly with the DIVA Protocol to redeem their position tokens for wTokens. This process involves the following steps:
The user calls the redeemPositionToken function in the DIVA Protocol, which burns the position tokens and returns the corresponding wTokens to the user.
To convert these wTokens into collateral tokens, the user must call the redeemWToken function in the AaveDIVAWrapper contract.
The redeemWToken function allows users to redeem their wTokens for the underlying collateral tokens by calling the internal _redeemWTokenPrivate function
This function performs the following steps:
Burns the user's wTokens.
Withdraws the corresponding collateral tokens from Aave V3.
Transfers the collateral tokens to the user.
However, if the collateral token is not supported by Aave V3, the withdraw function call will revert, leaving the user's wTokens burned but without access to the collateral tokens.
The issue is exacerbated by the fact that the wToken burning operation is irreversible. Once the wToken is burned, the user cannot recover it, even if the collateral token withdrawal fails.
Users who attempt to redeem their wTokens when the collateral token is unsupported will lose access to their funds. The wToken is burned, but the collateral token cannot be withdrawn from Aave V3.
Manual Review
Before burning wTokens and attempting to withdraw collateral tokens, validate that the collateral token is supported by Aave V3. If the token is unsupported, revert the transaction and avoid burning the wToken.
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.