Submitted by 0xStalin, also found by bin2chen and rvierdiiev
First depositor can manipulate the price of the shares at will, forcing new depositors to deposit more ETH for the same amount of shares that the first depositor paid.
Before diving into the details of how this attack is performed, lets understand how the Vault determines the amount of shares to mint for a deposited amount of ETH.
Now, time to analyze how the attack is performed:
The root cause that makes this attack possible is that the Vaults shares and assets are not initialized/seeded when the Vault is created & the fact that the totalAssets is dependant on the total aCollateralTokens the associated Strategy to the Vault is holding on its balance.
Consider either of these options:
hvasconcelos (BakerFi) confirmed
ickas (BakerFi) commented:
