Submitted by cmichel
yVault.sol#L144-L145
In deposit, the balance is cached and then a token.transferFrom is triggered which can lead to exploits if the token is a token that gives control to the sender, like ERC777 tokens.
Initial state: balance() = 1000, shares supply = 1000.
Depositing 1000 amount should mint 1000 supply, but one can split the 1000 amounts into two 500 deposits and use re-entrancy to profit.
The safeTransferFrom should be the last call in deposit.
spaghettieth (JPEGd) confirmed
spaghettieth (JPEGd) resolved and commented:
