56956 sc high lack of slippage control in tokemak strategies can make myt suffer losses on allocation
Description
Brief/Intro
Vulnerability Details
// @dev Implementation can alternatively make use of a multicall
// Deposit weth into the autoEth vault, stake the shares in the rewarder
function _allocate(uint256 amount) internal override returns (uint256) {
require(TokenUtils.safeBalanceOf(address(weth), address(this)) >= amount, "Strategy balance is less than amount");
TokenUtils.safeApprove(address(weth), address(router), amount);
// @audit min shares out are 0, lack of slippage control
// https://docs.auto.finance/developer-docs/integrating/4626-compliance#slippage
@> uint256 shares = router.depositMax(autoEth, address(this), 0);
TokenUtils.safeApprove(address(autoEth), address(rewarder), shares);
// @audit shares are never checked
rewarder.stake(address(this), shares);
return amount;
}Impact Details
References
Proof of Concept
Proof of Concept
Previous56451 sc low alchemistallocator allocate and deallocate do not enforce cap checks as intendedNext56947 sc low flawed access control in alchemistcurator admin transfer pattern leads to risk of permanent loss of control
Was this helpful?