The _handleTokenOperations function does not correctly handle fee-on-transfer tokens, which results in a mismatch between the wToken supply and the actual collateral deposited into Aave. This issue leads to long-term liquidity imbalances, where more wTokens exist than the underlying collateral, making redemptions unreliable.
Incorrect Assumption of Full Transfer
The function assumes that the entire _collateralAmount is received when calling safeTransferFrom(), but fee-on-transfer tokens (e.g., USDT, STA, certain DeFi tokens) deduct a fee, meaning less than _collateralAmount is actually received.
wTokens Are Minted Based on Requested Amount, Not Received Amount
_collateralAmount is blindly used to mint wTokens, leading to more wTokens being minted than actual collateral deposited into Aave.
π΄ Severity: High
β
Likelihood: High
β
Affected Parties: Protocol users and liquidity providers
A user deposits 100 fee-on-transfer tokens (e.g., a token with a 5% transfer fee).
The contract only receives 95 tokens but mints 100 wTokens.
Over time, as more fee-on-transfer tokens are deposited, wToken supply exceeds aToken balances.
Users can no longer fully redeem their wTokens because not enough collateral exists.
The protocol faces long-term liquidity issues, as wToken holders are unable to redeem their assets properly.
The protocolβs balance sheet becomes inaccurate, potentially leading to unexpected insolvencies.
An attacker deposits a fee-on-transfer token with a high transfer fee (e.g., 50%).
The contract mints wTokens equal to the full requested deposit, but only half the collateral reaches Aave.
The attacker redeems their wTokens immediately, withdrawing more collateral than they actually deposited.
Result: The attacker drains the liquidity pool, leaving other users with unredeemable wTokens.
π¨ Liquidity Drain β The attacker effectively extracts more value than deposited, leading to user losses.
PoC simulates a user exploiting this issue using a fee-on-transfer token.
Deploy FeeOnTransferToken with a 50% fee.
Deposit 100 tokens into AaveDIVAWrapper.
The contract mints 100 wTokens but only receives 50 tokens.
Withdraw 100 wTokens, draining collateral reserves.
Modify _handleTokenOperations to check how many tokens were actually received.
β
Ensures the minted wTokens match the actual deposited collateral.
β
Prevents liquidity imbalances.
To prevent any fee-on-transfer tokens from being used, enforce a whitelist of approved ERC20 tokens.
β
Prevents fee-on-transfer tokens from being registered.
β
Protects against future unexpected token behaviors.
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.