The strategy's total asset calculation includes WETH balances without providing any mechanism to handle WETH deposits or withdrawals, enabling a permanent share price inflation attack through direct WETH transfers.
In _harvestAndReport()
:
The strategy counts underlyingBalance
(WETH) in total assets but:
Has no mechanism to handle direct WETH deposits
Cannot process WETH withdrawals
Only handles WETH through transmuter claims and swaps
This is a simplified example of the idea of the attack, but better ROI of the loss numbers will be provided
There is one or two people in the strategy each of them deposited 1 alETH
Attacker sees a txn of the keeper calling report()
Attacker frontruns it with calling deposit of 4 alETH and direct donation of 2 wETH
the attacker now owns 67% percent of the value of the pool
report()
txn go through and reflect a _totalAssets
of 8e18 (2 wETH and 6 alETH).
attacker backruns the report()
with withdraw()
of all his shares.
attacker gets back 5.36 alETH and remains in the strategy 0.64 alETH withdrawable and 2 wETH unwithdrawable (since wETH can't be deployed in _deployFunds()
or swapped in any way)
First two users end with 0.82e18 each stuck unwithdrawable funds
Pre-report state:
Share distribution:
After report():
Attacker withdrawal (10e18 shares):
Final state:
Attacker's P&L:
Users' Losses:
This scenario is more devastating because:
Users have 100% of their alETH locked (10 alETH total)
Attacker doubles their alETH (+10 alETH profit)
Cost to attacker is only 20 WETH to lock 10 alETH
Users cannot withdraw anything (0 alETH remaining)
The above example will only work if Fees are (0), if not, then attacker will grief users a loss with the same amount he loses
Medium: Low impact, High severity
Permanent share price manipulation
Creation of unredeemable "dead shares"
Affects all subsequent depositors who receive fewer shares
WETH becomes permanently locked in contract
Breaks core ERC4626 vault functionality
Manual code review
Understanding of vault inflation attacks
Analysis of TokenizedStrategy share mechanics
Remove underlyingBalance
from total assets calculation:
Add emergency function to handle accidental WETH transfers:
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.