Skip to content
Business logic Audit finding Intermediate

The value of the burned peapods share token may exceed expectations

The Peapods strategy's deallocate function burns share tokens without any slippage protection, so if the collateral ratio changes between the operator's transaction being submitted and it being mined, more shares are burned than intended. An attacker or adverse market movement could cause the strategy to lose more user principal than planned.

pashap9990 Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

58326 sc insight the value of the burned peapods share token may exceed expectations

Submitted on Nov 1st 2025 at 09:45:31 UTC by @pashap9990 for Audit Comp | Alchemix V3

Description

Finding Description and Impact

Operators or administrators can deallocate assets from a designated strategy via MYTStrategy::deallocate. Furthermore, operators can set the withdrawal amount, resulting in the burning of the corresponding share tokens associated with MYTStrategy. Moreover, CR will shift in both directions (top and bottom) within Peapods, resulting in more Tokens of MYTStrategy being burned upon deallocation than expected, resulting in financial loss due to insufficient slippage management.

Textual PoC

  • MYTStrategy possesses 1000 Peapods share tokens. (CR = 1)
  • A 500 share token burn is anticipated by the operator. The operator's transaction will be sent to the mempool, and since the CR was 0.90 prior to the deallocation transaction, 555 share tokens—more than anticipated—will be burned.

Impact

There is "Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield - Critical" going on because bad CR changes during the deallocate operation make the strategy burn a lot more share tokens than planned (555 instead of 500 in this case). These extra shares that were burned represent real user funds that are lost forever when they are withdrawn. This is theft of principal funds "in-motion" instead of yield loss, because users lose money right away when their share amount drops below what it should. Attackers or bad market conditions can take advantage of the lack of slippage protection, which causes measurable fund loss on every deallocation transaction that is impacted.

Code Snippet

https://github.com/alchemix-finance/v3-poc/blob/a192ab313c81ba3ab621d9ca1ee000110fbdd1e9/src/strategies/mainnet/PeapodsUSDC.sol#L32

Proof of Concept

Proof of Concept

Kindly incorporate the following PoC in PeapodsUSDCStrategy.t.sol

Solidity
    function testPeapodsUSDCStrategySufferFromLackOfSlippgaeControl() public {
        uint amountToAllocate = 100e18;
        uint amountToDeallocate = 50e18;
        vm.startPrank(vault);
        deal(testConfig.vaultAsset, strategy, amountToAllocate);
        bytes memory prevAllocationAmount = abi.encode(0);
        IMYTStrategy(strategy).allocate(prevAllocationAmount, amountToAllocate, "", address(vault));
        uint256 initialRealAssets = IMYTStrategy(strategy).realAssets();
        require(initialRealAssets > 0, "Initial real assets is 0");
        bytes memory prevAllocationAmount2 = abi.encode(amountToAllocate);

        // Mock the entire withdraw function to return your desired shares amount
        vm.mockCall(
        PEAPODS_USDC_VAULT,
        abi.encodeWithSelector(
            IERC4626.withdraw.selector, 
            amountToDeallocate,
            address(strategy), // receiver
            address(strategy)  // owner
        ),
        abi.encode(60e18) // Return value: shares burned
        );
    
        // Also need to handle the token transfer that withdraw would do
        deal(USDC, strategy, amountToDeallocate);
        (bytes32[] memory strategyIds, int256 change) = IMYTStrategy(strategy).deallocate(prevAllocationAmount2, amountToDeallocate, "", address(vault));
    }

The original report as published on Immunefi, by pashap9990. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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

Root cause

Likely the deallocate function calls the Peapods vault's withdraw without a minimum-shares-out or slippage check, so the number of shares burned is whatever the current collateral ratio dictates at execution time.

Impact

The strategy could burn more share tokens than intended during deallocation, causing direct loss of user principal in motion; the report does not describe any defence that limited the exploit.

What the attacker needed

Operator or admin calls deallocate; collateral ratio changes before mining; no slippage bound on the withdrawal

The fix

The deallocate function should enforce a minimum acceptable number of shares burned (or equivalent slippage bound) so that execution reverts if the collateral ratio has moved beyond the operator's tolerance.

How it was found

  1. The strategy holds 1000 Peapods share tokens with a collateral ratio of 1.
  2. The operator submits a deallocation expecting 500 share tokens to be burned.
  3. Before the transaction is mined, the collateral ratio drops to 0.90.
  4. The deallocation executes and burns 555 share tokens instead of the expected 500.

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.

A strategy holds 'share tokens' that represent a portion of a pool. When an operator withdraws funds, the strategy burns some of those shares. If the pool's exchange rate changes before the withdrawal is processed, the strategy can end up burning more shares than the operator expected, which means users lose more money than planned. This is like agreeing to pay a bill in a foreign currency without locking in the exchange rate.

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.

More by pashap9990

View all

12 more disclosed reports, best first.

More from Alchemix V3

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.