58722 sc medium tokenauto strategy allocation uses maxdeposit which may allocate less than requested leaving any excess funds permanently locked
Description
Brief/Intro
//From the Auto Token router contract
function depositMax(
IAutopool vault,
address to,
uint256 minSharesOut
) public payable override returns (uint256 sharesOut) {
IERC20 asset = IERC20(vault.asset());
uint256 assetBalance = asset.balanceOf(msg.sender);
uint256 maxDeposit = vault.maxDeposit(to);
uint256 amount = maxDeposit < assetBalance ? maxDeposit : assetBalance;
pullToken(asset, amount, address(this));
approve(IERC20(vault.asset()), address(vault), amount);
return deposit(vault, to, amount, minSharesOut);
}Vulnerability Details
Impact Details
References
Proof of Concept
Proof of Concept
Previous58089 sc low arithmetic underflow revert in deallocate Next56692 sc medium zeroxswapverifier verification will always revert due to wrong hardcoded execution function selectors
Was this helpful?