58089 sc low arithmetic underflow revert in deallocate

Submitted on Oct 30th 2025 at 15:18:24 UTC by @PotEater for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #58089

  • Report Type: Smart Contract

  • Report severity: Low

  • Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/strategies/mainnet/TokeAutoEth.sol

  • Impacts:

    • Temporary freezing of funds for at least 24 hour

Description

Brief/Intro

The function _deallocate can revert due to an underflow.

The following code may revert:

uint256 shareDiff = actualSharesHeld - sharesNeeded;

This is possible when sharesNeeded > actualSharesHeld.

Vulnerability Details

Code snippet:

The issue is that when the function is trying to calculate the share difference, the code does not expect with sharesNeeded being of higher value than actualSharesHeld. There is no guard or validation before the subtraction to prevent this underflow.

The function should check or clamp the amount that is attempted to be withdrawn before performing the substraction.

Impact Details

The impact is Denial of Service as deallocations will cause to fail unexpectedly.

Freezing funds for at least 24 hours, until the strategy holds enough shares.

References

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

Proof of Concept

Proof of Concept

Add this PoC in path src/test/strategies/PoC.t.sol.

This PoC demonstrates how deallocation may revert with 0x11 panic revert.

Run with forge test --match-test test_deallocate_underflow_reverts -vvvv

PoC:

Result:

Was this helpful?