Tokeautousdstrategy claims rewards to itself automatically when deallocate is called but since reward token is tokemak the rewards remain permanently locked
The TokeAutoUSDStrategy automatically claims Tokemak rewards to itself when deallocate is called, but the strategy has no function to move or use those tokens. As a result, all collected rewards become permanently locked in the strategy contract.
- Disclosed after under an hour
58488 sc low tokeautousdstrategy claims rewards to itself automatically when deallocate is called but since reward token is tokemak the rewards remain permanently locked
Submitted on Nov 2nd 2025 at 17:11:32 UTC by @niroh for Audit Comp | Alchemix V3
- Report ID: #58488
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi\\_audit/src/strategies/mainnet/TokeAutoUSDStrategy.sol
- Impacts:
- Permanent freezing of unclaimed yield
Description
Brief/Intro
The TokeAutoUSDStrategy collects rewards from the Token Auto Rewarder contract automatically whenever _deallocate is called. This is done by setting the rewarder.withdraw() last parameter to true:
//From TokeAutoUSDStrategy::_deallocate()...
// withdraw shares, claim any rewards
rewarder.withdraw(address(this), sharesNeeded, true);
Internally the rewarder claims the reward to the sender by setting the second parameter of _processRewards (recipient) to the claiming account
//From MainRewarder _withdraw
if (claim) {
_processRewards(account, account, true);
}
The reward token of Rewarder is Tokemak (0x2e9d63788249371f1DFC918a52f8d799F4a38C94). Therefore, rewards are claimed as Tokemak balance added to the strategy.
Vulnerability Details
Since the TokeAutoUSDStrategy doesn't have any swipe function (or low level call functionality) there is no way to move, use or trade the Tokemak tokens accumulating in the strategy. This means all collected rewards remain permanently frozen.
The same is true for the TokeAutoEth strategy, with one difference which is that TokeAutoEth implements _claimRewards which enables anyone to call claimRewards on it directly. Hoever its implementation sends the gained Tokemak to the MYT vault: (rewarder.getReward(address(this), address(MYT), false);). Since it's MYT vault token is Eth, the tokens remain unreachable in this case as well (only in the MYT vault instead of the strategy).
Impact Details
Permanent Freezing of all rewards collected by the TokeAutoUSDStrategy and TokeAutoEth strategy
References
Proof of Concept
Proof of Concept
How to run:
- Copy the code below into the TokeAutoUSDStrategyTest contract in v3-poc/src/test/strategies/AaveV3ARBUSDCStrategy.t.sol
- Add the following imports and interfaces at the top of the file:
import "../libraries/BaseStrategyTest.sol";
interface IAccessController {
function grantRole(bytes32 role, address account) external;
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function owner() external view returns (address);
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
}
interface IMainRewarder {
function rewardToken() external view returns (IERC20);
function queueNewRewards(uint256 newRewards) external ;
function accessController() external view returns (IAccessController controller);
}
- run with
FOUNDRY_PROFILE=default forge test --fork-url https://mainnet.gateway.tenderly.co --match-test testRewardUnclaimable -vvv
function testRewardUnclaimable() public {
uint256 initialDeposit = getTestConfig().vaultInitialDeposit;
uint256 amountFirstAllocation = initialDeposit / 2;
vm.startPrank(allocator);
uint256 oldAllocation = VaultV2(vault).allocation(IMYTStrategy(strategy).adapterId());
bytes memory dataOldAlloc = abi.encode(oldAllocation);
VaultV2(vault).allocate(strategy, dataOldAlloc, amountFirstAllocation);
vm.stopPrank();
//emulate reward awarding to autoToken
bytes32 LIQUIDATOR_MANAGER = keccak256("LIQUIDATOR_ROLE");
IAccessController ac = IMainRewarder(REWARDER).accessController();
address whitelisted = ac.getRoleMember(LIQUIDATOR_MANAGER,0);
uint256 rewardAmount = 100e18;
IERC20 rewardToken = IMainRewarder(REWARDER).rewardToken();
uint256 rewardBal = rewardToken.balanceOf(strategy);
console.log("srategy tokemak before: %s",rewardBal);
deal(address(rewardToken),whitelisted,rewardAmount);
vm.startPrank(whitelisted);
rewardToken.approve(REWARDER,rewardAmount);
IMainRewarder(REWARDER).queueNewRewards(rewardAmount);
vm.stopPrank();
vm.warp(block.timestamp + 60*60*24);
vm.roll(block.number + 60*60*24);
//deallocate
vm.startPrank(allocator);
oldAllocation = VaultV2(vault).allocation(IMYTStrategy(strategy).adapterId());
dataOldAlloc = abi.encode(oldAllocation);
VaultV2(vault).deallocate(strategy, dataOldAlloc, amountFirstAllocation);
vm.stopPrank();
rewardBal = rewardToken.balanceOf(strategy);
console.log("srategy tokemak: %s",rewardBal);
}
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
All rewards collected by the TokeAutoUSDStrategy and TokeAutoEth strategy are permanently frozen.
What the attacker needed
Strategy has allocated funds; rewards are queued for the strategy
How it was found
- Allocate funds to the strategy.
- Queue new rewards for the strategy.
- Advance time to let rewards accrue.
- Call deallocate on the strategy.
- Observe that the strategy's Tokemak balance has increased and cannot be withdrawn.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When the strategy withdraws its funds, it also collects reward tokens and keeps them inside itself. But the strategy has no way to send those tokens out, so they are stuck forever. This is like a shop that receives a delivery but has no door to move the boxes out.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.