StrategyMainnet::_harvestAndReport is a function that should return an accurate and trusted total amount of 'ASSET' the strategy currently holds, including loose funds. However, the issue is that the function also includes the WETH balance, which cannot be claimed by users. This results in inaccurate asset and share value calculations within the vault, leading to a loss of funds.
Attacker can also use this vulnerability to grief users and make them lose their assets.
From the docs:
As seen in the current implementation of _harvestAndReport, the unexchanged variable is added to _totalAssets. The unexchanged variable represents the current balance of the WETH token within the strategy. However, WETH is the underlying token, not an asset, and cannot be withdrawn by users. Including it in the _totalAssets calculation leads to incorrect asset and share price calculations within the vault.
The WETH can be directly transferred to the strategy address, which may lead to unexpected share and asset prices, potentially opening the door to more serious exploits.
This is an edge case that arises when the keeper is configured to call report regularly, even when no deposits are made and no shares are minted. An attacker could exploit this situation, as WETH is not considered an asset.
The keeper calls report function.
The attacker front-runs it and sends 1 wei of WETH to strategy address.
_totalAssets is updated with current value = 1.
User deposits alETH into vault and exploits it using very well know "donation attack".
A second, more likely scenario involves an attacker transferring any amount of WETH into the vault at any time. This can cause users to receive more alETH than they should when withdrawing, effectively allowing to steal from the last user in the pool. This is a basic griefing attack that results in a loss of funds for the affected user. The direct transfer of WETH disrupts the vault’s share and asset price calculations.
The attacker can:
Deposit into the contract.
Directly send WETH.
Wait for a user deposit.
Withdraw the full amount (attackers alETH + the user's alETH equal to the amount of WETH sent by the attacker).
As a result the attacker lost nothing and the user can't withdraw the full deposited amount (skipping fees of course).
User can only withdraw the remaining alETH available in the strategy - WETH sent by attacker. The attacker could withdraw full deposited amount.
Adding balance of WETH into _totalAsstes calculation leads to incorrect prices for users. It can be exploited by an attacker to perform a griefing attack.
It is important to note that this report specifically addresses the vulnerability in the StrategyMainnet contract.
Manual review
Remove unexchanged from _totalAssets calculation.
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.